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...

How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?

Answer Posted / lince thomas

it is very simple,,below
------------------------
select * from(
select row_number() over(partition by empname order by
empname)as rno,empname,salary from Emp1Pay)T
where T.rno>1


delete from Emp1Pay where empid=
(select empid from(select row_number() over(partition by
empname order by empname)as rno,empid
from Emp1Pay )T where T.rno>1)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I find the size of a sql server database?

889


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

1054


Explain primary key, foreign key and unique key?

942


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

2449


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

969


What is data block and how to define data block size?

986


How to create a simple user defined function in ms sql server?

985


What is the difference between TRUNCATE and DROP?

1082


What is the difference between mysql and sql server?

958


How exceptions can be handled in sql server programming?

964


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

932


What is the maximum row of a size?

967


How to convert character strings into numeric values?

1056


How will you add a dimension to cube? : sql server analysis services, ssas

1026


What are the disadvantages of indexes?

1015