how to find the second highest salary from emp table?
Answer Posted / chirag shah
select DISTINCT(salary) from emp order by salary desc limit 1,1
this limit gives you 2nd record
if you want 3rd value then write limit 3,1
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Does oracle use sql?
how to return query output in html format? : Sql dba
What is sql comments?
explain mysql aggregate functions. : Sql dba
What are conditional predicates?
What is oracle sql developer?
How to pronounce postgresql?
What is the sql case statement?
What is difference between table and view?
How can you tell the difference between an index and a view?
How is debugging done?
discuss about myisam key cache. : Sql dba
What is the basic structure of an sql?
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
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