Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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

    > >
    > >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page