Home >Database >Mysql Tutorial >在Oracle数据库中查询第n条信息

在Oracle数据库中查询第n条信息

WBOY
WBOYOriginal
2016-06-07 17:28:391429browse

本人在开发程序中要的到Oracle数据库中某一条数据。如题。要得到第二条数据。

本人在开发程序中要的到Oracle数据库中某一条数据。如题。要得到第二条数据。表明为:t_ltr_kjmx

答案:select * from (select * from t_ltr_kjmx order by termcode desc) where playname='D3'and  rownum             minus
            select * from (select * from t_ltr_kjmx order by termcode desc) where playname='D3'and  rownum  
 
 
分析:Oracle中的minus的作用简单来说是去同留异。第一行sql表示查询前两条信息。第三行sql表示查询出第一条数据。minus

进行审查并去同留异 
 
 
结果:

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn