随机提取N条记录 推荐
            网络编程 发布日期:2025/10/31 浏览次数:1
         
        
            正在浏览:随机提取N条记录 推荐
            随机提取10条记录的例子: 
Sql server: 
 select top 10 * from 表 order by newid() 
Access: 
 Select top 10 * FROM 表 orDER BY Rnd(id)  
 Rnd(id) 其中的id是自动编号字段,可以利用其他任何数值来完成 
 比如用姓名字段(UserName) 
 Select top 10 * FROM 表 orDER BY Rnd(len(UserName))  
MySql: 
 Select * From 表 order By rand() Limit 10