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 is the purpose of indexing?

1000


What is a non equi join?

916


How to use group functions in the select clause in ms sql server?

996


What is constraints and its types?

879


What is policy based management (pbm)? : sql server database administration

931


Do you know what is rank function?

1035


What are the database roles? : sql server security

1077


How to test values returned by a subquery with the in operator?

1135


Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

937


What is instead of dml trigger?

953


How we can refresh the view?

1058


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?

918


What are sql server functions?

939


Does server sql treat char as a variable-length or fixed-length column?

954


How many types of keys are there?

968