人的头脑太复杂,时间过得久,有时候连自己也被自己骗了,记下来才是最真实的..
2007年2月6日 08:38

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的随机查询语句。

我要 [保存此页] [收藏此页] [复制此链接QQ/Msn发送]
收藏到 [天天] [和讯] [我摘] [天极] [新浪] [博采] [Del.icio.us]
我们推荐您 快去试试吧!
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]