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 / bhagya
select * from emp as e1 where 1= (select count(*)from emp
as e2 where e1.sal<e2.sal)
| Is This Answer Correct ? | 9 Yes | 11 No |
Post New Answer View All Answers
What are the different index configurations a table can have?
What is the default fill factor value?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?
Explain syntax for viewing trigger?
What is serializable?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
What is partition, how will you implement it? : sql server analysis services, ssas
How do I create an extended event in sql server?
What is sql stored procedure?
How to fine-tune reports?
what is a join? : Sql server database administration
1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
Explain atomicity?
What is 2nf normalization form?