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 / amit kumar

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

Select max(sal) from emptable where sal not in (Select
max(sal) from emptable)

(2) How to fetch all the duplicate records from the table.

SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>

Is This Answer Correct ?    10 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1014


What is the difference between commit and rollback?

947


Will sql server 2005 allow you to reduce the size of a column?

996


What is a trigger in sql server?

1180


How to get the definition of a view out of the sql server?

987


How to find which stored procedure is currently running in sql server?

997


Define master database?

1080


What is BLOCK statements in SQL?

1268


What is built-in function?

1015


What are the different types of collation sensitivity in sql server?

1114


What is the difference between functions and stored procedures?

1167


What is the difference between insensitive and scroll cursor?

1168


Are connections to sql server encrypted?

1008


What is acid properties?

1109


What are the aggregate and scalar functions?

1071