Home » SQL & PL/SQL » SQL & PL/SQL » sql query
sql query [message #1642] Fri, 17 May 2002 06:06 Go to next message
LAKSHMI NARAYANA
Messages: 12
Registered: May 2002
Junior Member
how to find eigth highest sal from emp;;;

oragurus kindly answer this pll
Re: sql query [message #1643 is a reply to message #1642] Fri, 17 May 2002 06:41 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> /
Enter value for n: 1
old 2: where &n = (select count(distinct sal) from emp
new 2: where 1 = (select count(distinct sal) from emp

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7839 KING PRESIDENT 17-NOV-81 5000 10

SQL> /
Enter value for n: 8
old 2: where &n = (select count(distinct sal) from emp
new 2: where 8 = (select count(distinct sal) from emp

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7934 MILLER CLERK 7782 23-JAN-82 1300 10
Previous Topic: how to retrive the data
Next Topic: Oracle autonumber using sequence n trigger
Goto Forum:
  


Current Time: Fri May 10 01:05:42 CDT 2024