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 / kavitha

select * from emp as a

where sal < 2 from emp as a1
on
(
a.idno=a1.idno
)

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cdc in sql server?

653


What is the sql profiler?

612


tell me the disaster recovery plan

2110


Explain transaction server auto commit?

620


How to convert character strings into numeric values?

683






what are the types of indexes? : Sql server database administration

671


Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?

664


What are different types of roles provided by ssrs?

118


Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?

573


How many full-text indexes can a table have?

643


in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it

1146


Tell me can we use custom code in ssrs?

668


What are points to remember while using the fillfactor argument?

638


what are statistics, under what circumstances they go out of date, how do you update them? : Sql server database administration

584


Explain what is the function of sql server agent windows service?

631