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

How do I setup a local sql server database?

948


Disadvantages of the indexes?

1050


How to loop through the result set with @@fetch_status?

1255


What is the default value of an integer data type in sql server 2005?

912


What are the benefits and tasks of object explorer? : sql server management studio

1116


How to execute function in stored procedure sql server?

1052


What is clr ddl trigger?

914


What is the library index called?

1003


What are the different types of data sources in ssrs?

188


How to create stored procedures with parameters in ms sql server?

993


What is an execution plan? When would you use it?

921


How to make a remote connection in a database?

927


How to find table changes in sql server?

1053


How can a database be repaired?

925


What the difference between UNION and UNIONALL?

988