sql随机函数

sql server的随机函数newID()和RAND()   

SELECT * FROM Northwind..Orders ORDER BY NEWID() 

--随机排序

SELECT TOP 10 * FROM Northwind..Orders ORDER BY NEWID() 

--从Orders表中随机取出10条记录  

MsSql随机取数据 select top 10 * from c_cy_admin order by newid()
Access 随机取数据 select  SELECT top 10 id FROM 表1 order by rand(id)
mySql 随机取数据 SELECT id FROM gueze order by rand() limit 10 

你可能感兴趣的:(sql,c,mysql,SQL Server,Access)