Find 2nd Highest salery in emp table
Select* from emp where &n=
select * count from emp where (salery >=emp.salery)
Enter n value 2
These query is correct or not. Tell me any other methods.
Answer Posted / kb
select top 1 * from emp
where sal < (select max(sal)from emp)
order by sal desc
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is primary key, unique key, and foreign key?
What is a domain constraint give an example?
What are the dmvs? : sql server database administration
Which tcp/ip port does the sql server run on? How can it be changed?
Why are you getting errors when creating a new odbc dsn?
What are the tools available in market as an alternative to sql server reporting services?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
What are the differences between triggers and stored procedures?
How to enter unicode character string literals in ms sql server?
When does the auto update index statistics feature in sql server turn itself on?q) what specific conditions database should meet, before you can bulk copy data into it using bcp?
What are approximate numeric data types in ms sql server?
Can sql servers linked to other servers like oracle?
Can you please explain the difference between function and stored procedure?
Do you have any idea about the tcl commands?
What are the commands used in DCL?