select distinct values

  • There are two options here.

    select distinct field1, field2

    from table

    or

    select field1, field2

    from table

    group by field1, field2

    Option 1 is the better for performance if you have a large table

  • That is fine

    But I want to get the duplicate records deleted from my table

    and get the final result

    how is this possible in sql 2000

    Thanks

  • select distinct name,salary

    into #temptab

    from tablename

     

    truncate table tablename

     

    insert into tablename

    select name,salary from #temptab

     

    regards

  • Thanks Sanjay.

    It is working fine

Viewing 4 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply