Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Following are some of the question related to below
mentioned query?

select e1.salary from employee3 e1
where 2=
(
select count(distinct(e2.salary))
from employee3 e2 where e2.salary>=e1.salary
)

1) What the query returns?

2) How it works? - Detail explanation (what the sub query
does, why it is (where 2=)....etc...Please?

Answer Posted / ashok

Hi

1.Here query will return 2nd highest salary
2.here 2= i.e 2nd heigest similary if we set N in place
of 2 then it will returen Nth heigest salary
where n =1,2,3,4.....

Hope it will help u

Ashok

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you know if the row fetched from cursor is still valid in underlying table?

1046


How to drop an existing table with "drop table" statements in ms sql server?

1147


What are scheduled tasks in sql server?

1140


Does a server store data?

953


you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration

1159


Does the unique constraint create an index?

1133


How to list all login names on the ms sql server?

1184


Explain the truncate command?

1037


While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?

1106


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

1150


How to convert character strings into numeric values?

1149


Does a specific recovery model need to be used for a replicated database? : sql server replication

1012


How do I save a stored procedure in sql server?

1052


How to create view in stored procedure sql server?

1057


What encryption security is available in sql azure?

101