Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)归海一刀
published in(发表于) 2014/2/1 0:18:14
从SQL,SERVER中随即搜索出几条数据_[SQL,Server教程]

从SQL SERVER中随即搜索出几条数据_[SQL Server教程]

select top 1 * from table order by newid()


top后面的数字就是你要随即搜索出来几条数据


这个方法只适用sql server


SELECT top 4 * FROM 表 ORDER BY Rnd(id)

这句适用于ACCESS的,大家可以参考


select * from table_name order by rand() [limit num];
mysql的随机查询语句。







If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759