adspace


How to find only %th Highest Sal

Answer Posted / sujitpingale

Ans: select distinct(a.salary) from customers a where &n =
(select count(distinct(b.salary)) from customers b where
a.salary <= b.salary);

Enter value in inputbox. If you enter 1 then it will give
highest salary

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 bcp? When does it used? : Sql dba

1065


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2102


Is primary key clustered index?

1028


What is the current version of postgresql?

1188


Can we rollback truncate?

1083


If a cursor is open, how can we find in a pl/sql block?

1252


how to escape special characters in sql statements? : Sql dba

1124


What is the best sql course?

1064


Is inner join faster than left join?

1287


what is sql server agent? : Sql dba

1189


Does group by remove duplicates?

1121


Can delete statement be rollbacked?

1065


What is your daily office routine?

2353


What is the current version of sql?

1106


Do we need to rebuild index after truncate?

1154