sql语句去重问题
Select TOP 30 * From T_Subject Order By NEWID()
去重复
select TOP 30 * from T_Subject where id in(select distinct id from T_Subject) Order By NEWID() 哪里有问题...
------解决方案--------------------top 30 里面也有重复的id 哦。
去重复参考
http://bbs.csdn.net/topics/240034273
------解决方案--------------------select top 30 * from (select distinct * from T_Subject)t order by newid()