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 / lince
select top 1 * from (select distinct top 2 * from emp order by sal desc)t order by sal asc
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
You are designing a strategy for synchronizing an SQL Azure database and multiple remote Microsoft SQL Server 2008 databases. The SQL Azure database contains many tables that have circular foreign key relationships?
What is compound operators?
What does it mean if @@cursor_row returns a negative number?
What authentication modes does sql server support?
What are the advantages of using cte?
What is triggers in ms sql server?
What is a view and what are its advantages?
Does full backup break log chain?
What is a partition function in sql server?
What is merge replication?
1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?
What is open database communication (odbc)?
What is master database? : SQL Server Architecture
explain different types of constraints? : Sql server database administration
Explain acid?