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

Find columns used in stored procedure?

993


‘Order by’ is not allowed in a view how can you sort information from a view?

1091


What Is Rdbms?

1169


How do you create a data source?

918


How do I setup a sql server database?

1079


What is cte (common table expression)?

1040


Can you explain what are various ways to enhance the ssrs report?

1004


Is t sql the same as sql server?

986


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

1142


What is the exact numeric data type in sql?

1006


there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration

930


Does windows server 2016 come with sql server?

939


How can you fetch alternate records from a table?

965


Retrieve the unique rows from table without using UNIQUE and DISTINCT keywords.

1014


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

1049