木子屋 Dnawo's BLOG

随机取出数据库N条记录

👤 dnawo 📅 2009-04-02 👁 4350 👍 0 💬 0 🔄 杰明工作室
ACCESS:
select top n * from 表名 order by rnd(id) --id为自动编号

MSSQL:
seelect top n * from 表名 order by newid()

MYSQL:
select * from 表名 order By rand() limit n

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 sql where id in() 按in排序的问题 下一篇 → 淘宝店美化三步曲