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

Explain the Ways to improve the performance of a sql azure database?

84


You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?

1053


Can you please explain the difference between primary keys and foreign keys?

1171


How display code or Text of Stored Procedure using Sql query in Sql Server ?

1201


How to specify the collation for a character data type in ms sql server?

1089


How many categories of functions based their return modes?

1152


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

1055


What is scrollable cursor?

1080


What the different topologies in which replication can be configured?

1144


What are the difference between “where” and “having” clause in sql server?

1134


mention different types of relationships in the dbms?

1091


What is an index in sql?

1070


Do you know exporting and importing utility?

1107


How to connect to SQL Azure Database by using sqlcmd?

140


How to use “drop” keyword in sql server and give an example?

1194