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 / rajkumar v

Ans:1
select Column_Name from Table_Name group by Column_Name
having count(Column_Name )>1

Ans:2
salary - column name

SELECT TOP 1 salary FROM (SELECT DISTINCT TOP 2 salary FROM
Table_Name ORDER BY salary DESC) A ORDER BY salary

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are database files and filegroups? : Sql server database administration

882


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

967


Explain the steps to create and execute a user-defined function in the sql server?

917


What are four major operators that can be used to combine conditions on a where clause?

983


Explain transaction isolation levels in sql server?

1034


What is difference between equi join and natural join?

963


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

986


How do I find the default sql server instance?

902


Please illustrate physical database architecture? : SQL Server Architecture

935


What is cte (common table expression)?

976


What does this statement do @@rowcount?

921


How to use subqueries with the in operators in ms sql server?

1004


Explain primary key, foreign key and unique key?

933


Differentiate between SQL and ORACLE joins and write their syntax.

975


Explain syntax for dropping triggers?

884