can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com
Answer Posted / syaam
select a.sal from emp a
where 2=(select count(distinct b.sal) from emp b
where a.sal<= b.sal)
for getting nth max sal ..replace 2 by n
all the best
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the advantages of paper records?
what is unique and xaml nonclustered index
What are the new features of sql server 2008 r2 reporting service?
Why use “pivot” in sql server?
Find nth lowest salary or get nth lowest salary?
What is transaction server isolation?
You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?
List the different index configurations possible for a table?
What is the largest component inside a field?
What is cte (common table expression)?
What are the different index configurations a table can have?
You are designing a database for your human resources department in the employee table, there is a field for social security number, which cannot contain null values if no value is given, you want a value of unknown to be inserted in this field what is the best approach?
What is user-defined multi-statement table-valued function?
What language is sql server written in?
What purpose does the model database server?