Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • OEM-troubleshooting on 20-MAY-08 Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • Virtual Indexes in Oracle Oracle
  • exp syntax in oracle 10g Oracle
  • setting prompt display with .profile Linux/Unix
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • Oracle GoldenGate lag monitoring shell script Linux/Unix
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • Pending Distributed Transations Oracle
  • get_vmstat.ksh for Solaris Oracle

Order by with ROWNUM

Posted on 03-Jan-2007 By Admin No Comments on Order by with ROWNUM

18:02:01 PVM@AWRTEST:-> select * from pvm1;

NO

———

100

20

40

1

2

200

24

7 rows selected.

Elapsed: 00:00:00.01

18:02:17 PVM@AWRTEST:-> select no from ( select no, row_number() over (order by no desc) r from pvm1) where r=2;

NO

———

100

1 row selected.

Elapsed: 00:00:00.02

18:02:38 PVM@AWRTEST:-> select no from ( select no, row_number() over (order by no ) r from pvm1) where r=1;

NO

———

1

1 row selected.

Elapsed: 00:00:00.01

Oracle, SQL scripts

Post navigation

Previous Post: xargs use
Next Post: Sort with ASCII order and Numeric Order

Related Posts

  • online_ts_bkup.sql Oracle
  • Changing Instance Name ( No DB_NAME) Oracle
  • Wait Based Tuning Step by step with SQL statement Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • Rollback force for distributed transactions Oracle
  • currwait.sql Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • Removing Blank lines from file using grep Linux/Unix
  • Reading config file from other folder inside class Python/PySpark
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • EXTPROC Oracle
  • chk_space_SID.ksh Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme