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

What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas

1017


What is user-defined multi-statement table-valued function?

1051


How to use user defined functions in expressions?

1079


how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }

2333


Which language is supported by sql server?

1004


Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?

949


What is trigger in salesforce?

975


Explain the disadvantages of cursors?

1132


what is denormalization and when would you go for it? : Sql server database administration

1168


What are the basic functions for master, msdb, model, tempdb and resource databases?

980


Explain about sql server login?

1075


What is the difference between stored procedure and user defined functions?

1182


How secure is sql server database?

997


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

952


How to download and install the scaled-down database adventureworkslt?

986