how u can find the n row from a table?
Answer Posted / rishab
select emp_name,salary,rownum from
(select emp_name,salary,r from
(select salary,emp_name,rownum r from
(select salary,emp_name,rownum
from emp
order by salary desc)
order by r)
where r<4 ---- this number must be n+1
order by salary)
where rownum=1;
-- yes rownum=1 works...
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is the starting oracle error number? What is meant by forward declaration in functions?
What do you mean by field in sql?
What is compiled query?
Can we rename a column in the output of sql query?
Show the cursor attributes of pl/sql.
What does count (*) mean?
What sql does db2 use?
Does inner join return duplicate rows?
What are the two different parts of the pl/sql packages?
what are set operators in sql? : Sql dba
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
Explain what is table in a database?
What is a database trigger?
Is pl sql different from sql?
How consistent is the view of the data between and within multiple sessions, transactions or statements ?