求一SQL语句写法
我现在多表查询得到以下结果
name tel linkman manager
aaa 123 000001 sss
aaa 234 000002 sss
ccc 789 544515 sss
ccc 456 555555 sss
vvv 888 566666 kkk
我向让每个name只显示一条记录,如:
name tel linkman manager
aaa 123 000001 sss
ccc 456 555555 sss
vvv 888 566666 kkk
应该怎么写?
------解决方案--------------------select name,min(tel) as tel,max(linkman) as linkman,min(manager) as manager from table1 group by name