j9988的不错,select distinct top 5 * from table只能取前5条记录。
偷偷地说我不同意,可以吗?简单点: select distinct top 5 * from Tablename order by newid()
to: PFPF 不过不可以 试了么?好像不行耶 出错 ORDER BY items must appear in the select list if SELECT DISTINCT is specified.要不用这个 :)多了一列 select distinct top 3 *,newid() from dis order by newid()
select distinct top 5 * from Tablename order by newid()
PFPF
不过不可以
试了么?好像不行耶
出错
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.要不用这个 :)多了一列
select distinct top 3 *,newid() from dis order by newid()