how to retrieve the top 2 salaried persons from a database?

Answer Posted / rajkumar

select top 1 colmn from table_name where colmn in
(select top 2 colmn from table_name where colmn is not
null order by colmn desc)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is raid? How does it help storage of databases?

610


what is the difference between primary key and unique key? : Sql dba

533


how to convert dates to character strings? : Sql dba

539


What are string functions in sql?

682


What is java sql connection?

518






What are the types of sql commands?

555


List and explain the different types of join clauses supported in ansi-standard sql?

827


Explain the types of joins in sql?

575


What are different types of keys?

530


What is count * in sql?

558


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

1733


How show all rows in sql?

616


Can pl sql procedure have a return statement?

554


What is composite primary key in sql?

526


Why do we use procedures in pl sql?

527