可以用存储过程吗?
首先建个表T1.表中包含两个列,ID,timu
CREATE PROCEDURE sp_1 AS
BEGIN
DECLARE @i as int
DECLARE @timu as char(40)
SET @i = 1
DECLARE C1 Cursor READ_ONLY For
SELECT TOP 你要挑选的题目的个数 题目的列名 FROM 你要查的表名 ORDER BY NEWID()
OPEN C1
FETCH NEXT FROM C1 INTO @timu
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO T1 VALUES(@i,@timu)
@i = @i+1
END
CLOSE C1
END
GO
这时你所要的东西就在T1这个表里了.select * from T1就行了.