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

in tabase table having a column in it empname field is
there which having 5 duplicate values is there i want
deleted all the duplicates i want showing only one name
only.

Answer Posted / dinesh gupta

Kumar your query do not solve the purpose accurately.

It should be as

Delete from employee where empid
not in (Select min(empid) from employee group by empname
having count(empname)>=1)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a partition key?

954


How to get a list of columns in a view using the "sp_help" stored procedure?

1033


Can we insert data if clustered index is disabled?

941


What is key attribute?

933


What is the purpose of floor function?

1039


Differentiate between truncate vs delete in mssql?

1083


can we have a nested transaction? : Sql server database administration

1095


What are the different types of replication you can set up in sql server?

1052


What are the components of sql server service broker?

1016


Define cursor locking

1007


Is foreign key a primary key?

1092


While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?

1042


Can the “if update (colname)” statement be used in a delete trigger?

990


What is replication and database mirroring?

1047


How to run sql server 2005 books online on your local system?

961