Tuesday, October 5, 2010

Elminatinig duplicate values in databse table

 emp1 --->temporary empty table
dept----> original table with columns and rows
we use distinct key word to eliminate duplicate values
1.move the records from dept to a temporary table emp1 
     select distinct * into emp1  from dept

2 delete the original table dept
     drop table dept

3. move emp1 records to dept table
     select * into dept from emp1

4.check the original table
    select * from dept


No comments: