SQL查找某一条记录的方法

2023年 4月 16日 22.1k 0

SQL查找第n条记录的方法: selecttop1*fromtablewhereidnotin(selecttopn-1idfromtable)temptable0 SQL查找第n条开始的m条记录的方法: selecttopm*fromtablewhereidnotin(selecttopn-1idfromtable)temptable0) (注:表中必须有一个

SQL查找第n条记录的方法:
select top 1 * from table where id not in (select top n-1 id from table) temptable0
SQL查找第n条开始的m条记录的方法:
select top m * from table where id not in (select top n-1 id from table) temptable0)
(注:表中必须有一个唯一值字段才可适用此方法。) 

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论