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

I have a table EMP in which the values will be like this

EmpId Ename Sal DeptId
11 Ram 10000 10
11 Ram 10000 10
22 Raj 20000 20
22 Raj 20000 20
33 Anil 15000 30
33 Anil 15000 30

I want to delete only duplicate Rows. After Delete I want
the output like this

EmpId Ename Sal DeptId
11 Ram 10000 10
22 Raj 20000 20
33 Anil 15000 30



Answer Posted / ashim kumar pal

SET rowcount 3

delete distinct * from table

set rowcount 0

select * from table

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the acid properties?

1005


What are the extra roles available in msdb? : sql server security

1135


Explain alternate key, candidate key and composite key in sql server?

916


What are the different types of upgrades that can be performed in sql server?

1177


Is the order of columns in the set clause important in ms sql server?

970


What is public role in sql server?

1153


What is a recursive stored procedure in sql server?

1175


List out what other servers you can use with ssrs?

139


How to verify a login name with sqlcmd tool?

1221


What does the not null constraint do?

1088


What are the three different part of rdl file explain them?

268


What are the types of subquery?

1042


what are candidate key, alternate key and composite key? : Sql server database administration

917


Will the writetext statement activate a trigger?

1095


In what version of sql server were synonyms released?

942