SQL 随机数
select floor(rand()*100);
--求随机数据
Solution 1 : SELECT TOP 1 * FROM [tablename] ORDER BY NEWID()
Solution 2 :
Declare @ID INT
SELECT @ID=floor(rand()*100)
SELECT TOP 1 * FROM [tablename] WHERE ID=@ID
SQL 随机数
select floor(rand()*100);
--求随机数据
Solution 1 : SELECT TOP 1 * FROM [tablename] ORDER BY NEWID()
Solution 2 :
Declare @ID INT
SELECT @ID=floor(rand()*100)
SELECT TOP 1 * FROM [tablename] WHERE ID=@ID