Hi All,
I have information as following:
Name Age ID
Frew 11 3333333
Freni 23 3333323
Frew 11 3333333
As you can see first row and third row contain same record, how could I remove it?
Thanksselect distinct Name,Age,ID into newtable from oldtable
drop table oldtable
exec sp_rename 'newtable', 'oldtable'|||In addition to Rudy's, you can try this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;139444|||Thanks guys it works|||>>select distinct Name,Age,ID into newtable from oldtable
Because the newtable wont have any indices or contraints that oldtable have, it is better to script the structure of the oldtable and rename table name and run and then this query
Insert into newtable(Name,Age,ID) Select Distinct Name,Age,ID from oldtable|||Thank you for providing useful information
If I have 10 records, do I have to run the insert command 10 times?
Thanks|||No Only that Single select will insert all the rows
Wednesday, March 28, 2012
remove duplicae data
Labels:
3333323frew,
3333333freni,
age,
database,
duplicae,
followingname,
idfrew,
microsoft,
mysql,
oracle,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment