An employee table, with the columns id, name, sal and dob.
Query to select emp names of all highest salaries(there are
4-5 people having the same salary which happens to be the
highest).









Answer Posted / anil

select name,sal from employee where sal in(select top 5 sal from employee order by sal desc)

Is This Answer Correct ?    7 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to list all field names in the result set using mssql_field_name()?

524


hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.

2468


If any stored procedure is encrypted, then can we see its definition in activity monitor?

547


How and why use sql server?

539


What is raid and what are different types of raid levels?

590






What is a primary key?

536


What is format parameter in ssrs?

109


What is the maximum size of column in sql server?

503


How to create view in stored procedure sql server?

501


What do you mean by acid?

572


What is sql server used for?

552


Can you explain important index characteristics?

520


What command do we use to rename a database?

611


What is the data tier application?

145


Does sql server 2000 full-text search support clustering?

505