Delete duplicate?

Hi all,
I need delete duplicate row in table A
I was trying with
delete a
where aa in (select aa from a group by a having count(*)>1)
but I need leave one row in table and other (duplicate rows) delete.
Whats the best way to do this?
thanks

delete from emp a where rowid<(select max(rowid) from emp b where a.empno=b.empno)

Similar Messages

  • How can i delete duplicates from my itunes account?

    At "View" I chose "Show duplicates."
    Now what do I do to delete duplicates quickly without having to delete each one separately?
    THanks

    Hello, singinheart. 
    Thank you for the question.  Since you have already identified the duplicate media you just have a couple more steps to go.  This article outlines the remainder of the steps in order to mass delete the duplicates. 
    How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/ht2905
    Cheers,
    Jason H. 

  • How do you delete duplicate tracks off your playlist?!

    How do you delete duplicate tracks off your playlist - everytime I connect my hard-drive it adds another of every single track - argh!!!!
    I remember there being a 'delete duplicate tracks' option on a much older version of itunes - is this still available and if not if you opt for the 'consolidate library' option will this automatically save to you computer as I have too much music for my laptops memory capacity! On top of that how can I stop this issue from contantly re-occuring everytime I connect my hard-drive?! Apologies if im being thick here.... xX*laura*Xx

    You are doing something wrong, iTunes doesn't add tracks to the library unless you ask it to, so there is a problem somewhere in your workflow which is creating the duplicates. For example, having iTunes set up to "Copy files to the iTunes Media folder when adding to library" and then repeatedly adding in a folder from an external drive would do it.
    Once you've worked out how to stop creating new duplicates you can look at the issue of deduping what you already have. See this recent post for some thoughts and a script that may prove useful.
    tt2

  • How do you delete duplicate songs in your library without having to delete each song individually??

    How do you delete duplicate songs in your library without having to delete each song individually?

    mauijiminar wrote:
    Go to iTunes, select view and click show duplicates. Hold control and A ( select all) and then delete.
    Not a good idea! The "show duplicates" feature shows "all" duplicate tracks, but you only want to delete the "extra" copies, not the "originals".
    I've written a script called DeDuper which can help remove unwanted duplicates. See this  thread for background, including how to delete the extra tracks manually if you prefer.
    tt2

  • How do I delete duplicate songs, but keep a link in their original albums to the single copy of the song left, so it will play in each album in sequence as if it were still there?

    Greetings!
    After importing my 300 or so CDs into iTunes, I found I have tons of duplicate songs.
    Example: I have a song that came in a original album, then in again in a "Greatest Hits" album, then again in a "Hits of the 80's" album, and again in a soundtrack album. I have now have 4 copies of the exact same song.
    How do I delete duplicate songs, but keep a link in their original albums back to the single copy of the song left, so it will play in each album in sequence as if it were still there?
    I don't think this currently exists, but as my library keeps growing the duplicates keep growing.  It would be nice if Apple sees this and adds a way to link songs to multiple albums.
    I don't want to create a custom playlist for every album that has a duplicate song or two (I'd have dozens of playlists) - thought about fixing it that way but not really practical.

    To my knowledge, there is no way of doing what you want. The only workaround is to create playlists for the other albums containing the track, but that isn't practical for most people.
    You could provide Apple with feedback here: http://www.apple.com/feedback/itunesapp.html

  • How do you delete duplicate photos in the photo section of your iPad?

    How do you delete duplicate photos in the photo section of your iPad?  My iPad has duplicated n tripled my photos n want let me delete them.  I can delete photos from any other section but not in photos, this is taken up all my memory. Help!!

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • How do I delete duplicate songs from my library that have been automaticly downloaded from itunes?

    How do you delete duplicate songs from an iphone 3gs?  I did the automaticly download song feature when doawloading from my CPU and now there are 11 songs that no matter what I do will not come off my phone.  I have tried everything.  Also how do you shut off this automatic download feature?

    Hello momoandfam,
    Welcome to Apple Support Communities.
    Take a look at the article linked below, it’ll answer your questions about finding and deleting duplicate tracks in your iTunes library.
    Find and remove duplicate items in your iTunes library - Apple Support
    Take care,
    -Jason

  • Is there a way to automatically detect and delete duplicate photos in a library

    I just imported a load of photos into my main iPhoto '11 Library from several older MAC's Photo Libraries. Despite repeatedly using the "Don't Import Duplicate Photos" dialogue box, I have many duplicate photos. Is there a way to automatically detect and delete Duplicate Photos?
    I also have iPhoto Library Manager installed on my MAC, but cannot seem to locate on it anything that would do this.
    I have over 4,000 photos, so would really appreciate some help here! Thanks in advance...

    duplicate annihilator - http://www.brattoo.com/propaganda/
    And NEVER import an iPhoto library into another iPhoto library - doing so des not work and creates massive duplication
    if you still have all of the original iPhoto libraries I recommend you drag the bad one you created to the desktop (delete it later when everythin has successfully been completed) and start over usin iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  to merge the libraries
    LN

  • How to delete duplicate music in itunes

    I have been downloading a lot of my old CD's and have found I have a lot of duplicate songs from a variety of my album sets...how can I delete them so I only have one of each one?
    thanks!
    Jan

    Dupin may be what you need. If you have the same song as part of different albums then, in my opinion, these aren't really duplicates. Personally I wouldn't throw away some of the tracks on the Beatles "White Album" because I also have them on the "Blue Album".
    For some more thoughts, including tips on how to manually delete duplicates if you have the patience, see this post. It's written from a PC perspective so you may need to use Option or Cmd instead of Shift or Ctrl.
    tt2

  • How to delete duplicate rows in a table

    hai,
    i have a table which consists of hunderds of records and contains duplicate records also. how can i delete duplicate records.
    thanks
    ravi

    This maybe a litle bit fast for deletion:-
    delete from emp where rowid in (
    2 SELECT rowid FROM emp
    3 group by rowid,empno,ename,job
    4 minus
    5 SELECT min(rowid) FROM emp
    6 group by empno,ename,job);

  • How to delete duplicate photos in iphoto

    working in iphoto and want to delete duplicates that were created when I used migration assist to import the iphoto library to new machine.  it duplicated all of my pictures.  Using iphoto 9.1.3

    Did you import one Library to another? That's the usual cause of this.
    If you still have the original library the simple solution is to just trash the damaged Library and do it again. This time don't import the LIbrary, just open it.
    Other than that For dealing with duplicates in iPhoto check out Duplicate Annihilator
    Regards
    TD

  • HOW TO DELETE DUPLICATE ELEMENT IN A VECTOR

    Hi everybody!
    If I've a vector like this vectA={apple,orange,grape,apple,apple,banana}
    and I want final result be vectB={apple,orange,grape,banana}.
    How should I compare each element in vectA and delete duplicate element. Like here duplicated element is apple. Only one apple remain in the vectB.
    Any help,
    Thanks.

    Hello all. Good question and good answers, but I would like to elaborate.
    To begin with, you specifically asked to map the following:
    {apple,orange,grape,apple,apple,banana} ==> {apple,orange,grape,banana}
    Both of cotton.m's solutions do NOT do this, unfortunately. They are both useful in particular cases though, so think about what you're trying to do:
    cotton.m's first solution is best if order does not matter. In fact, as flounder first stated, whenever order doesn't matter, your most efficient bet is to use a Set instead of a List (or Vector) anyways.
    Set vectB = new HashSet(vectA);This code maps to {banana, orange, grape, apple}, because HashSets are "randomly" ordered.
    cotton.m's second solution is good if you want to impose NEW ordering on the List.
    Set vectB = new TreeSet(vectA);This code maps to {apple, banana, grape, orange}, because TreeSet uses alphabetical-order on Strings by default.
    java_2006, your solution is the most correct, but it's a little verbose for my taste :)
    more importantly, the runtime-efficiency is pretty bad (n-squared). calling Vector.contains performs (at worst) n comparisons; you're going to call it n times! Set.contains usually performs 2 comparisons (constant, much better), so I suggest you USE a Set to do the filtering, while still sticking with your good idea to use a List. When the ordering is "arbitrary" (so can't use TreeSet) but still relevant (so can't use HashSet), you're basically talking about a List.
    I think saving A LOT of time is worth using A LITTLE extra space, so here, let's save ourself some runtime, and some carpal-tunnel.
    import java.util.*;
    class Foo {
         public static void main(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List     l = Arrays.asList(fruits),
                   m = filterDups(l);
              System.out.println(m);
         // remember, both of the following methods use O(n) space, but only O(n) time
         static List filterDups(List l) {
              List retVal = new ArrayList();
              Set s = new HashSet();
              for (Object o : l)
                   if (s.add(o))
                        retVal.add(o);     // Set.add returns true iff the item was NOT already present
              return retVal;
         static void killDups(List l) {
              Set s = new HashSet();
              for (Iterator i = l.iterator(); i.hasNext(); )
                   if (! s.add(i.next()))     
                        i.remove();
         // honestly, please don't use Vectors ever again... thanks!
         // if you're going to be a jerk about it, and claim you NEED a Vector result
         // then here's your code, whiner
         public static void mainx(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List l = Arrays.asList(fruits);
              Vector v = new Vector(l);
              killDups(v);
              System.out.println(v);
    }

  • How to delete duplicate pictures in iPhoto

    I have many duplicate pictures in iPhoto. Is there an easy way to identify and delete duplicates?

    Check out Tidy Up!

  • How to delete duplicate records in all tables of the database

    I would like to be able to delete all duplicate records in all the tables of the database. Many of the tables have LONG columns.
    Thanks.

    Hello
    To delete duplicates from an individual table you can use a construct like:
    DELETE FROM
        table_a del_tab
    WHERE
        del_tab.ROWID <> (SELECT
                                MAX(dups_tab.ROWID)
                          FROM
                                table_a dups_tab
                          WHERE
                                dups_tab.col1 = del_tab.col1
                          AND
                                dups_tab.col2 = del_tab.col2
                          )You can then apply this to any table you want. The only differences will be the columns that you join on in the sub query. If you want to look for duplicated data in the long columns themselves, I'm pretty sure you're going to need to do some PL/SQL coding or maybe convert them to blobs or something.
    HTH
    David

  • How to delete duplicate record in Query report

    Hi Experts,
    I had created an infoset and query in my sap, but I want to delete some duplicate records before the list out put.Please can we add some further codes in the Extras code to delete duplicates? And how do it? Would you please give me a simple brief.
    Joe

    Hi,
    You can try to restrict in the filter area in query designer with the values for characteristic which gives correct
    result.
    But still i would suggest that in the cube you keep not the duplicate records as this is not your requirement and giving
    you wrong result.
    So you can reload the correct records in the cube inorder to avoid such problems even in future.
    Regards,
    Amit

  • How to Delete duplicate Records in Table

    CREATE GLOBAL TEMPORARY TABLE MyTable1 (
    Name1 varchar2(100)
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('11');
    insert into MyTable1 values ('12');
    insert into MyTable1 values ('12');
    select * from MyTable1
    I want to delete duplicate names from MyTable1..And after delete I should have 11 and 22 only.

    I got the answer
    delete from MyTable1
    where rowid not in
    (select max(rowid)
    from MyTable1
    group by Name1
    having count(1) > 1
    )

Maybe you are looking for