查询的t.real_name字段,不在group by的字段中
SQL:
select max(case when 1=1 then t.real_name end),t.user_id from lus_user t group by t.user_id
结果:
1 建华 825899
2 江涛 121823
3 争平 121944
SQL:
select max(case when 1=1 then t.real_name end),t.user_id from lus_user t group by t.user_id
结果:
1 建华 825899
2 江涛 121823
3 争平 121944