T-sql一些例子
select * from [表名] where [条件] order by newid()---随机取几条数据
select Top[条数] * from [表名] where [条件] order by newid()---随机取前几条数据
select DISTINCT * from [表名] where [条件] ---过滤重复结果
select DISTINCT SUBSTRING(No,0,7) as KT from T_Nos ---截取字符串 过滤重复