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 / elumalai.k
select id,max(salary)from employee where salary<(select
max(salary)from employee)
| Is This Answer Correct ? | 15 Yes | 6 No |
Post New Answer View All Answers
What is merge replication?
How would you add a section to a table?
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
What is the difference function and stored procedure?
What is the difference between the 2 operating modes of database mirroring?
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.
What are types of subqueries?
How can delete duplicate records in cte in sql server?
What keyword you will use to get schema appended to the result set of a ‘for xml’ query?
What is filestream?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?
How optimize sql query with multiple joins in sql server?
What is sql server query analyzer?
When would you use sql joins?