I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000
Answer Posted / sudip mondal
select top 1 from employee where ID in (select top2 ID from
employee order by Salary desc) order by Salary asc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which table keeps information about stored procedures?
What are magic tables in sql server?
How to count duplicated values in a column in ms sql server?
How can we get count of the number of records in a table?
Do you know what guidelines should be followed to help minimize deadlocks?
Create and insert into temp table in sql server?
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
Explain external key management in sql server 2008
Differentiate sql server reporting services vs. Crystal reports?
what is normalization? : Sql server database administration
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
Can we call future method from trigger?
Give an example of why you would want to denormalize a database
What is schemabinding a view?
Which tcp/ip port does sql server run on? How can it be changed?