select top 2 *
from 结果集
order by checksum(newid())
from 结果集
order by checksum(newid())
解决方案 »
- 简化SQL语句
- 呵呵,不知道这个语句的执行效率怎么样,我第一次写链接查询。
- 请教:两难的MS-SQLSERVER聚集索引问题
- 求解,关于数据库的几个简单问题?在线等待...
- 我数据库里显示时间格式都是这样的:3/25/2004 7:50:39 PM 能不能设置一下变为这样呢:2004-9-25 19:50:39
- MS-SQL查询问题..在线等...
- 要把 “一 三 四 五 二” 排序为 “一 二 三 四 五” 需要用什么排序规则
- 急~~~~~~~~~,请问:怎样快速的把XML导入SQL数据中
- VB数据库高手来挑战一下这个问题
- 单据审核通过后的修改问题
- 设置事务隔离问题,如何正确操作?
- 帮忙简化一下存储过程
create table test1
(
name varchar(50)
)
insert into test1 select '单位A'
insert into test1 select '单位B'
insert into test1 select '单位C'
insert into test1 select '单位D'
insert into test1 select '单位E'
insert into test1 select '单位F'
insert into test1 select '单位G'
insert into test1 select '单位H'
insert into test1 select '单位I'
insert into test1 select '单位J'
insert into test1 select '单位K'select top 2 *
from test1
order by checksum(newid())
drop table test1