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 p.ColumnName from tablname p group by p.ColumnName

ans2:

Select min(salary)FROM emp WHERE (salary IN (SELECT
TOP 2 salary FROM emp ORDER BY salary DESC))
Or
Select top 1 salary from (select top 2 salary from emp
order by salary desc) emp order by salary

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?

1180


what are different types of raid configurations? : Sql server database administration

1099


What do you understand by a view?

1047


ow to bring suspect mode datbase online from scratch

1856


How can we remove orphan records from a table?

1029


Explain triggers?

1063


How to access the deleted record of an event?

1091


What is dbcc?

1179


What is primary key and example?

996


What is xml datatype?

1129


What are recommended options to be used while using db mirroring? : sql server database administration

1223


How is table type constraint applied to a table?

1023


can we have a nested transaction? : Sql server database administration

1189


How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

1057


What are the differences between char and varchar in ms sql server?

1121