adspace


Find 2nd Highest salery in emp table

Select* from emp where &n=
select * count from emp where (salery >=emp.salery)


Enter n value 2


These query is correct or not. Tell me any other methods.

Answer Posted / kb

select top 1 * from emp
where sal < (select max(sal)from emp)
order by sal desc

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert character strings into numeric values?

1192


Disadvantages of the indexes?

1225


do you know how to configure db2 side of the application? : Sql server database administration

1125


What are wait types?

1250


What is in place upgrade in sql server?

1127


What is subquery? Explain the properties of a subquery?

1063


You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1215


How to convert numeric expression data types using the cast() function?

1151


Is it possible to have clustered index on separate drive from original table location?

1041


How do I find the sql server version?

1103


What is sql server query analyzer?

1131


Explain system functions or built-in functions? What are different types of system functions?

1067


What is a coalesce function?

1285


List the ways in which dynamic sql can be executed?

1087


What is normalization and what are the advantages of it?

1057