Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Deleting Duplicates

Discussion in 'Information Technology' started by Gina, Jul 28, 2006.

  1. Gina

    Gina
    Expand Collapse
    Guest

    I can get a list of dups. I want to delete just the actual duplicate (not
    the original). If I have 6 records that match, I want to delete 5 of them
    only.

    Please, How can I do this?

    Thank You.

    --
    Gina
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Is Mahesh Bhatt considering deleting Meera's controversial kissing ... Breaking News Mar 4, 2005

  3. lgalumbres@gmail.com

    lgalumbres@gmail.com
    Expand Collapse
    Guest

    Hi,

    Not sure what you mean by " I want to delete just the actual duplicate
    (not
    the original)." ? If they are duplicate records meaning a row is
    repeated multiple times then there is no distinction to which one is
    the original record.

    But in any case, you can use the DISTINCT keyword to get each distinct
    record in your table and insert the results into another table. The
    result would give you a copy of your table without the duplicates.
    Something along these lines....

    SELECT DISTINCT Column1, Column2
    INTO TableNoDups
    FROM TableWithDups
    GROUP BY Column1, Column2

    Cheers!
    - Lem


    Gina wrote:
    > I can get a list of dups. I want to delete just the actual duplicate (not
    > the original). If I have 6 records that match, I want to delete 5 of them
    > only.
    >
    > Please, How can I do this?
    >
    > Thank You.
    >
    > --
    > Gina
     
  4. Gina

    Gina
    Expand Collapse
    Guest

    That works perfectly, thank you.
    --
    Gina


    "lgalumbres@gmail.com" wrote:

    > Hi,
    >
    > Not sure what you mean by " I want to delete just the actual duplicate
    > (not
    > the original)." ? If they are duplicate records meaning a row is
    > repeated multiple times then there is no distinction to which one is
    > the original record.
    >
    > But in any case, you can use the DISTINCT keyword to get each distinct
    > record in your table and insert the results into another table. The
    > result would give you a copy of your table without the duplicates.
    > Something along these lines....
    >
    > SELECT DISTINCT Column1, Column2
    > INTO TableNoDups
    > FROM TableWithDups
    > GROUP BY Column1, Column2
    >
    > Cheers!
    > - Lem
    >
    >
    > Gina wrote:
    > > I can get a list of dups. I want to delete just the actual duplicate (not
    > > the original). If I have 6 records that match, I want to delete 5 of them
    > > only.
    > >
    > > Please, How can I do this?
    > >
    > > Thank You.
    > >
    > > --
    > > Gina

    >
    >
     
  5. lgalumbres@gmail.com

    lgalumbres@gmail.com
    Expand Collapse
    Guest

    no problem. cheers!

    Gina wrote:
    > That works perfectly, thank you.
    > --
    > Gina
    >
    >
    > "lgalumbres@gmail.com" wrote:
    >
    > > Hi,
    > >
    > > Not sure what you mean by " I want to delete just the actual duplicate
    > > (not
    > > the original)." ? If they are duplicate records meaning a row is
    > > repeated multiple times then there is no distinction to which one is
    > > the original record.
    > >
    > > But in any case, you can use the DISTINCT keyword to get each distinct
    > > record in your table and insert the results into another table. The
    > > result would give you a copy of your table without the duplicates.
    > > Something along these lines....
    > >
    > > SELECT DISTINCT Column1, Column2
    > > INTO TableNoDups
    > > FROM TableWithDups
    > > GROUP BY Column1, Column2
    > >
    > > Cheers!
    > > - Lem
    > >
    > >
    > > Gina wrote:
    > > > I can get a list of dups. I want to delete just the actual duplicate (not
    > > > the original). If I have 6 records that match, I want to delete 5 of them
    > > > only.
    > > >
    > > > Please, How can I do this?
    > > >
    > > > Thank You.
    > > >
    > > > --
    > > > Gina

    > >
    > >
     

Share This Page