不必这样吧?select * from 表 a,(select s_CNo,min(id) as id from 表 group by s_CNo) as b where a.id=b.id
更正一下:select a.* from 表 a,(select s_CNo,min(id) as id from 表 group by s_CNo) as b where a.id=b.id或者: select a.* from 表 a where not exists ( select * from 表 where s_CNo=a.s_CNo and id>a.id )
where a.id=b.id
where a.id=b.id或者:
select a.* from 表 a
where not exists (
select * from 表
where s_CNo=a.s_CNo
and id>a.id
)