利用管道在SQL中实现查询分页显示和筛选

Posted 锦心绣口,珠烁晶莹

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了利用管道在SQL中实现查询分页显示和筛选相关的知识,希望对你有一定的参考价值。

 

 分页显示:

[[email protected] ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | more

SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 24 13:04:17 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> FUNCTION ACCEPT_SQL_PROFILE RETURNS VARCHAR2
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------
 TASK_NAME            VARCHAR2        IN
 OBJECT_ID            NUMBER            IN     DEFAULT
 NAME                VARCHAR2        IN     DEFAULT
 DESCRIPTION            VARCHAR2        IN     DEFAULT
--More--

 

筛选:

[[email protected] ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | grep DROP
PROCEDURE DROP_SQLSET
PROCEDURE DROP_SQL_PROFILE
PROCEDURE DROP_TUNING_TASK

 

[[email protected] ~]$ echo "desc dbms_sqltune"|sqlplus / as sysdba | grep DROP_SQL_PROFILE -A 7    //从匹配字符处开始再往下显示7行
PROCEDURE DROP_SQL_PROFILE
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------
 NAME                VARCHAR2        IN
 IGNORE             BOOLEAN         IN     DEFAULT
PROCEDURE DROP_TUNING_TASK
 Argument Name            Type            In/Out Default?
 ------------------------------ ----------------------- ------ --------

 

以上是关于利用管道在SQL中实现查询分页显示和筛选的主要内容,如果未能解决你的问题,请参考以下文章

SQL 初级编程 分页显示数据

用Servlet与JSP中实现分页查询

java中数据库中实现分页的sql语句要求每页十条要查询的是第二页

如何在 SQL for MS Access 中实现分页?

如何在 SQL for MS Access 中实现分页?

如何在后端自定义查询中实现分页