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

2022-02-23 10:38:13 码农 2042

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

—— 完 ——
  • 数据库恢复是在故障引起数据库瘫痪以及状态不一致以后...
  • Sqlite:SQL logic error no such table: Base_SysLog
  • 操作类型“ExecuteWorkflowAction”对于 WorkflowIdentity 元素无效
  • 工业安装工程的分项工程质量验收记录表签字人不包括( )。
  • 网络安全评价技术及可生存性随机模型方法研究
  • You have an error in your SQL syntax; check the manual that corresponds to your MySQL
  • MSSQL为表添加表名描述
  • SQL Server游标的使用
  • SQL 3NF第三范式
  • C#操作SQLite方法实例详解

© CopyRight 2014~2024 薄学网.