如题所述
select distinct(id) from table where name !=''
温馨提示:答案为网友推荐,仅供参考
第1个回答 2015-02-28
select id,name from test where id = 1 and name is not null追问
我的意思是当id相同的情况下查询出那么不为空的数据,并不是说id就一定等于1
追答select id,name from test where name is not null group by id,name