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 sql profiler. What are the default templates with it? : sql server database administration

692


Where sql server usernames and passwords are stored in a sql server?

661


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1764


What are system databases into sql server (2005/2008)?

763


Can we use custom code in ssrs?

781






what does the automatic recovery do? : Sql server administration

737


What is a transact-sql statement?

709


What is filtered index?

821


How to connect sql server management studio express to sql server 2005 express?

750


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1348


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

4016


What is multilevel indexing?

694


How can a database be repaired?

732


What is a result set object returned by mssql_query()?

739


Can binary strings be used in arithmetical operations?

687