从数据库表中随机获取N条记录的SQL语句

Oracle

select * from (select * from tableName order by dbms_random.value) where rownum < N
MS SQLServer

select top N * from tableName order by newid()
My Sql

select * from tableName order by rand() limit N

—— 完 ——
相关推荐
评论

立 为 非 似

中 谁 昨 此

宵 风 夜 星

。 露 , 辰

文章点击榜

细 无 轻 自

如 边 似 在

愁 丝 梦 飞

。 雨 , 花