Results 1 to 2 of 2

Thread: HELPPPPPPP

  1. #1

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Angry

    I've got a table inside my database.
    But, the table creates duplicates itself...

    So, for 1 unique record will duplicates to 2 or 3 records.

    My question is...
    How can I delete the duplicates ??? Coz, when I try to delete, even just 1 records of them, all of the same records will be deleted automatically.

    Could anybody help ???

    For your information, I'm using SQL Server ver. 7.0

    Cheers,
    Wen Lie
    Regards,
    [-w-]

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Sydney, Australia
    Posts
    74
    to be honest I'm not entirely sure of how to do this with sql server, but this is the theory:

    form a new table based on selecting the distinct rows from the table

    something like

    create table2 as (
    select distinct *
    from table1);

    I've never used sql server before so i am not sure of the syntax, but something similar must be possible. Sorry I can't give you working code.

    It begs the question though, why is there no primary key?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width