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...

1. How to fetch all the duplicate records from the table.

2. How to fetch the second highest salary from the table.

Answer Posted / devraj

(1) Query to fetch all duplicate records:

Select * From emp02 Where Rowid Not In (Select Min(Rowid)
From emp02 Group By No, ename, Work)

(2) Query to fetch 2'nd highest salary:

Select * From (Select a.*, dense_rank () Over (Order By sal
Desc) Vb From emp02 a) Where Vb = 2;

Is This Answer Correct ?    7 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What protocol does sql server use?

935


How would you choose between a clustered and a non-clustered index?

963


What is a synonym for manipulation?

983


What does man by sql wildcard characters in sql server?

1052


can any body tell me how to know the password of current user in sql server

2070


what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration

901


What is sql server 2000 work load governor?

1053


what is blocking? : Sql server database administration

1029


State the difference between union and union all?

924


What is the most common type of join?

985


What are the types of database schema? : sql server analysis services, ssas

1124


Explain tablesample?

989


What is a file group?

1084


How will you decide the active and passive nodes?

1123


What are the types of normalization?

1025