select * from (select * from sampleImage s where not exists(select 1 from sampleImage where sphID=s.sphID and imgID>s.imgID)) t where imgID not in ( select top 1imgID from ( select * from sampleImage s where not exists(select 1 from sampleImage where sphID=s.sphID and imgID>s.imgID))t) --imgID自己選擇大小
not in ( select top 1imgID from ( select * from sampleImage s where not exists(select 1 from sampleImage where sphID=s.sphID and imgID>s.imgID))t)
--imgID自己選擇大小
字段:imgID,sphID(有重复) 如何查询出sphID不重复的结果,并且要从第2条开始显示???????????????
----------------------
以什么 排序 ?
from sampleImage as s
where s.sphID in (select top 1 distinct(sphID) from sampleImage)这个可能可以,你试试
from sampleImage as s
where s.sphID not in (select top 1 distinct(sphID) from sampleImage) 忘记写not 了