Union all-distinct and remove duplicates from nested table?

Hi all,
I need a select that will bulk collect some data in my nested table.
I have two tables from which I need to select all the accounts only once.(remove duplicates).
Tried to search on the forum...but no luck.
I have a table with one column:
create table a1(account_no number);
and a second table with 3 columns.
create table a2 (account_no number, name number, desc varchar2 (100));
I have a nested table like:
table of a2%rowtype;
Can I select from this two table in one select and put in my nested table just one row per account?
if a I have in a 2a row like :
1 'test' 'test2'
2 aaaa aa
and in a1 a row like:
1
I want to put in my nested table just (1, null,null and 2,aaaa, aa)) or (1,test,test2 and 2,aaaa, aa). it does no matter what row from those two I insert.
Second question:
If I use:
BANNER
Oracle9i Release 9.2.0.5.0 - Production
PL/SQL Release 9.2.0.5.0 - Production
CORE     9.2.0.6.0     Production
TNS for 32-bit Windows: Version 9.2.0.5.0 - Production
NLSRTL Version 9.2.0.5.0 - Production
SQL>
what is the best solution to remove duplicates from a neste table like mine?
I thought that I can build another nested table and loop in my first nt and for each row I check in there was the same account in previous lines.
it will be like:
for i in 1....nt_first.count loop
for j in 1..i loop
    --check if my line was in previous lines. if it was...do not move it in my second collection
end loop;it is this best option in oracle 9i?

I have a table with one column:
create table a1(account_no number);
and a second table with 3 columns.
create table a2 (account_no number, name number, desc varchar2 (100));
all I need are the accounts. the rest ar extra data
that I can ignore in this step. But if it is
available, it is ok to use it.
using one select in this case is is much better that
trying to remove duplicates parsing some nested table
with FOR many times?
Thankshi,
try to use union. Union automatically removes duplicates between two or more tables.
with t1 AS
       (select '3300000' account_no FROM DUAL UNION
        select '6500000' account_no FROM DUAL union
        select '6500000' account_no FROM DUAL union
        select '6500000' account_no FROM DUAL union
        select '6500000' account_no FROM DUAL
       select * from t1ACCOUNT_NO
3300000
6500000

Similar Messages

  • What is the best app for identifying and removing duplicates from iPhoto Libraries/Pictures?

    I have five iPhoto Libraries (original, default merged, etc.)  I've tried using iPhoto Library Manager, but I seem to be digging a deeper hole.  Also, question about the 15,000 faces:  Are these taking up space on my hard drive?  I gather I cannot easily remove them from libraries.  Taking photos at concerts, sporting events, etc. just creates more faces in iPhoto;  frankly, I could do without ANY FACE DETECTION!

    These applications will identify and help remove duplicate photos from an iPhoto Library:
    iPhoto Library Manager - $29.95
    Duplicate Annihilator - $7.95 - only app able to detect duplicate thumbnail files or faces files when an iPhoto 8 or earlier library has been imported into another.
    PhotoSweeper - $9.95 - This app can search by comparing the image's bitmaps or histograms thus finding duplicates with different file names and dates.
    DeCloner - $19.95 - can find duplicates in iPhoto Libraries or in folders on the HD.
    DupliFinder - $7 - shows which events the photos are in.
    iPhoto AppleScript to Remove Duplicates - Free
    PhotoDedupo - $4.99 (App Store) -  this app has a "similar" search feature which is like PhotoSweeper's bitmap comparison.  It found all duplicates
    Duplicate Cleaner for iPhoto - free - was able to recognize the duplicated HDR and normal files from an iPhone shooting in HDR
    Some users have reported that PhotoSweeper did the best in finding all of the dups in their library: iphoto has duplicated many photos, how...: Apple Support Communities.
    If you have an iPhone and have it set to keep the normal photo when shooting HDR photos the two image files that are created will be duplicates in a manner of speaking (same image) but there are only twp apps that detected the iPhone HDR and normal photos as being duplicates:  PhotoSweeper and Duplicate Cleaner for iPhoto.  None of the other apps detected those two files as being duplicates as they look for file name as well as other attributes and the two files from the iPhone have different file names.
    iPLM, however, is the best all around iPhoto utility as it can do so much more than just find duplicates.  IMO it's a must have tool if using iPhoto.

  • Adding and Removing Rows from a Table

    So first time user here so hold on. I am creating a form in Adobe, using the LiveCycle Designer. It has help files on creating a table and having it grow as data is entered. So I create a table and follow the steps but nothing happens. Not sure what I am doing wrong here.
    CustomerTable.Row1.instanceManager.addInstance(1);
    This is code for my button. It is place in the first data row of the table. I inserted a subform so that I could have to buttons there.
    I labeled everything accordingly (my table is called 'CustomerTable'). When I go to previeiw or save it and open as a regular pdf i will not give me more rows to enter information in. Is this syntax wrong or am I just retarded today?
    Ben

    Post your question in the LiveCycle Designer forum.

  • Best app to remove duplicates from iTunes 2014

    Hi All,
    I've been trying to research the best application to sort and remove duplicates from my iTunes library. I have over 7000 songs and iTunes built in duplicate finder doesn't look at the track fingerprint, which is useful for those songs which are labelled "Track_1" etc.
    Has anyone reviewed any recent products? I was looking at TuneUp, but after reading so many negative comments, I've decided not to go down that path. I would prefer a program that did most of the work for me, due to the amount of songs. Happy to pay for a good product...
    I do have MusicBrainz Picard, which has done a great job of tagging, but don't remove duplicates.
    Thanks in advance :-)

    Tune up is a great app.  When they moved from version 2 to version 3 is when it went to crap and all heck broke loose.  They shut their doors  but they have since re opened and went back to developing  version 2.  I use that version and I am pretty happy with it as being an overall cleanup utility.  I also use Musicbrainz and a couple of other utilities but in the end if you have an enormous library 20k plus then you are going to have a few slip through.  I would probably go with Tuneup if I were you and a thorough third party duplicate finder.  Dupe Guru's music edition seems to do a pretty good job.

  • Find and remove duplicates advice?

    hi all,
    would it be possible to get a little advice and some feedback on others' experience with finding and removing duplicates from the aperture database?
    i am doing this now for scans, pdf's, images and other data on my mac book pro and on my mac pro and it would be helpful for me to know what is possible for me to get done with the aperture database.
    TIA

    I haven't used it  myself but  Duplicate Annihilator it is mentioned here often as a solution for this.

  • Trigger how to get new and old value for nested table column?

    Hi,
    I have created a nested table based on the following details:
    CREATE TYPE typ_item AS OBJECT --create object
    (prodid NUMBER(5),
    price NUMBER(7,2) )
    CREATE TYPE typ_item_nst -- define nested table type
    AS TABLE OF typ_item
    CREATE TABLE pOrder ( -- create database table
    ordid NUMBER(5),
    supplier NUMBER(5),
    requester NUMBER(4),
    ordered DATE,
    items typ_item_nst)
    NESTED TABLE items STORE AS item_stor_tab
    INSERT INTO pOrder
    VALUES (800, 80, 8000, sysdate,
    typ_item_nst (typ_item (88, 888)));
    Now I would like to create a trigger on table pOrder for after insert or update or delete
    and I would like to track the new and old value for the columns inside nested table.
    Can anybody direct me how to do it?
    I would like to know the sytax for it like:
    declare
    x number;
    begin
    x := :new.nestedtablecolumn;--how to get the new and old value from nested table columns
    end;
    Hope my question is clear.
    Thanks,
    Lavan

    Hi,
    Try like this:
    CREATE OR REPLACE TRIGGER PORDER_I
    BEFORE INSERT
    ON PORDER
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    DECLARE
      items_new typ_item_nst;
      ordid_NEW NUMBER;
    BEGIN
    FOR i IN :new.items.FIRST .. :new.items.LAST LOOP -- For first to last element
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').prodid: ' || :new.items(I).prodid );
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').price:  ' || :new.items(I).price );
    END LOOP;
    END;Regards,
    Peter

  • HT2905 i have just followed all the insrtuctions in support to remove duplicates from my library but now most of my musicis gone except for my recent purchases. How come and how do i fix it?

    i have just followed all the instructions in support to remove duplicates from my library but now most of my music is gone except for my recent purchases. How come and how do i fix it?

    Final Cut is a separate, higher end video editor.  The pro version of iMovie.
    Give iPhoto a look at for creating the slideshow.  It's easy to assemble the photos in an album in iPhoto, put them in the order you want and then make a slideshow of them.  You can select from various themes and transitions between slides and add music from your iTunes library.
    When you have the slidshow as you want use the Export button at the bottom of the iPhoto window and export with Size = Medium or Large.
    Save the resulting Quicktime movie file in your Movies folder.
    Next, open iDVD, choose your theme and drag the QT movie file into the menu window being careful to avoid any drop zones.
    Then follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    The reason I suggest iPhoto is that I find it much easier to use than iMovie (except for the older iMovie 6 HD version).  Personal preferences showing here.

  • How can I find and remove duplicate photos from my computer?

    How can I find and remove duplicate photos from my computer?

    Terence,
    Yes, the duplicates appear in the iPhoto window. I have folders with same name occuring two or even three times sometimes with exactly the same set of photos (ie photos with the same ID) and sometimes with a limited set of photos. Other  folders appear only once.
    I normally take my MacBook with me if I'm shooting a lot of photos, such as on holiday, and then want to transfer them to my iMac when i get home. Other times I transfer the camera's memory stick directly to my iMac.
    I have great difficulty transferring the photos from my MacBook to my iMac. I don't want to store my photos on my iDisk due to the length of time it takes to upload them.
    Thanks again.
    Simon

  • How to identify and remove duplicate plugin effects from AE cs5 please?

    hello,
    i installed some trial plug in effects for AE and PPRO cs5
    cycore, boris, trapcode
    the PPRo went great
    however, with the AE i get notices that multiple instances of 'such and such' effect
    is installed more than one time...there's about 15 that give me a warning each time i start AE...
    i tried my best to locate any duplicates but no luck
    How do you identify and remove duplicate plug in effects for AE CS5?
    thanks,
    j

    hello,
    it is nice when you can answer your own question...
    looked in 'common...media core...' and found the new blue trial plugins
    also had the duplicates of the new blue plugins in the AE plugins 'effects' folder
    deleted the plugins from the 'media core' folder
    no more warning signs...
    cool deal
    back to work,
    j

  • I just updated to creative cloud cc, I need to backup my creative suite set( all cs5) and remove from my mac- i need the operating space what do i do

    I just updated to creative cloud cc, I need to backup my creative suite set( all cs5) and remove from my mac- i need the operating space what do i do
    i don't want to just back up my plug ins. i want to back up the whole suite can i do this?
    tks in advance

    Be sure to retain your serial number.  If you don't have it check your Adobe account online for it in your products section - I recommend keeping a copy of it on hand wherever you call home.  The installation files are currently available thru...
    CS5 - http://helpx.adobe.com/creative-suite/kb/cs5-product-downloads.html

  • Referencing multiple cells and removing duplicate values.

    Hello.
    I have a very complicated question, to be honest I am not totally sure if numbers is capable of handling all of this but it's worth a shot.
    I am working on a spreadsheet for organising a film. I've had the templates for years but I'm now using numbers to automate it as much as possible. Everything was going well until I hit the schedule/callsheet.
    On other sheets I can tell it to "look up scene two" it will then look up the correct row and find everything I need. On the callsheet however I might say "we're filming scenes two, five and nine" and numbers gets confused with the multiple values, Is there anyway around this?
    Also, if there is, I have a more complex question to ask. Is it possible for numbers to find and remove duplicate data? For example lets say scene two and five require Alice, but scene nine requires bob. If numbers just adds that info together it will display the result "Alice Alice Bob", is there a way to get it to parse the text, recognise the duplicate value and remove the unnecessary Alice? 
    I realise that numbers has limitations so it may not be able to do everything I want, however every bit I can automate saves me hours so even if I can only get half way there, totally worth it.
    Thanks in advance for any help you can offer, all the best.

    Ah excellent thank you.
    I've modified it to there are now multiple (well only four for now until I get this in better shape) indexes for finding a scene. And assigning each block to a new row.
    I only have one slight reservation about this. If I create 10 rows, it totally works, most of the time we'll only shoot three scenes a day so it's just blank space... However Murphy's law will inevitable raise its ugly head and put me in a situation where we are shooting 11 scenes in a day. 
    For countif, I think I get what you mean... Kinda. Basicially I would create a cell which combines the character strings from each scene into one long scene. Then I would have 100 extra cells (Lets say 100 so I'll never run out) each linked to the cast list, using the character name as a variable. These cells will each parse through the string to find their character name. If it appears then a true value comes up. This will remove duplicates as each cell will only respond once. So if Alice appears in every scene shooting that day, the cell will still only light up once. Is that it.
    One other question. Whenever I combine filled cells with blank cells. I usually gets the data from the filled cells, with a 0 for each blank cell. Usually this isn't a problem, but if I want to keep this flexible then I'll have quite a few blanks. The actor example above could result in 98 zeroes. Is there anyway to have blanks just not show up at all.
    I'll email the spreadsheet in a moment, a lot of it is still rough and under construction, but you should be able to see where it's all going hopefully.
    Thanks again, you have been extraordinarily helpful. 

  • HT2905 No Display Duplicates under File. How to find and remove duplicate items in your iTunes library

    I now have iTunes ver 11.0.4.4 under Windows 7. I lost all iTunes stuff when updating to Windows 7. I have loaded thousands amd thousands of music files from backup disks, but there are many duplicates. I am attemping to re-establish my old library. I used to be able to remove duplicates quickly with the old iTunes. The new iTunes doesn't seem to offer the same service. Is there any way to remove duplicates quickly, or must I do it one by one?

    When deduping use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks. If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    See also HT2905: How to find and remove duplicate items in your iTunes library
    tt2

  • Would like to use WD MyBook external SOLELY for my iPhoto library and remove it from my hard drive to clear up space. How do I do this?

    I just bought a 3TB My Book that I would like to store my iPhoto library on and remove it from my hard drive completely. I am running Time Machine with another external drive as back up and would like to use Time Machine to also back up my photos that will be on my My Book external. How do I move my iPhoto library to my new external and delete it from my hard drive? The catch is that I only want this new external to be for my iPhoto. I don't want Time Machine to start backing up my entire hard drive, since I already have an external dedicated to back up. I have not attached my external yet because I am afraid it will automatically start backing up my entire hard drive. I am very experienced on a Mac but not very technical so please, no big words and THANKS MUCH in advance!!

    First format the drive to OS X Extended (journaled) with ownership set to be ignored:
    Next drag your iPhoto library from your Pictures folder to the EHD.  When the copying is complete launch iPhoto with the Option key held down and in the window that comes up select the library on the EHD:
    Check the file path under the window to make sure the correct library has been selected.
    Once you've confirmed that the EHD library is working properly and has all of your photos you can delete the library in your Pictures folder.
    OT

  • How do I put photos in an album and remove them from the camera roll?

    I would like to be able to move photos into an album and remove them from the camera roll. Is this possible?
    I take many photos of mundane things that I simply want to remember, such as serial number of products. I would like to save these photos for viewing, but I don't want them to appear in my camera roll, where I have to continuously scroll through many such photos to get to the ones that I want to view there.
    I know that Apple has a "hide" feature, but it doesn't actually do anything. When I press-and-hold on individual photos, the photos stay in the camera roll: they aren't hidden at all. It's not clear what the purpose of this function is at all.

    You don't do this, as the photos are in the camera roll.  That is where they live.  When you make an album you are simply making a list of pointer to your photos in camera roll.
    If you remove them from the camera roll, then they are gone. 
    Photos in albums are not in two places.  They are in only one place, the camera roll.  The album merely contains pointers to those pics, so that you can categorize them however you like.
    You should be importing these pics to your computer.  I find it far easier to organize my photos on my computer, then sync them to the iPhone.

  • I have about 130 gigs of movies on my iTunes and was wondering if I can just put them on my backup hard drive and remove them from my main computer to free up the space

    I have about 130 gigs of movies on my iTunes and was wondering if I can just put them on my backup hard drive and remove them from my main computer to free up the space.

    I haven't done this with an external drive, but I would imagine it works the same way as if you have multiple internal drives.  Also hopefully it works with less headache in OSX than in windows.
    Anyway, move all your music over to your external, and then go into itunes -> preferences -> advanced -> iTunes media folder location.  Navigate to your drive, and pick the folder you want.  Ensure that your folders are set up like they are in your ~/Music/iTunes folder, or wherever your iTunes is currently pointing.  Then quit and restart itunes.  If your music doesn't show up, try dragging your music folder from your external onto itunes, and it will hopefully update your library.xml.
    As far as Jerry's problem goes, you could try adding another music folder to your library.xml, but I really have no idea whether this will work or not.  If you want to give it a try (can't promise you won't corrupt your library.xml, so make a copy beforehand) you can find the music folder xml element right near the top of the xml file (open it with textedit/textmate/whatever text editor you want (NOT WORD)).  Curious to know if this works, and if it doesn't I have other ideas so let me know.

Maybe you are looking for

  • How to delete the entries in a approval status report

    Hi, I have designed approval procedure for marketing document.The approval procedure works fine.But there are certain documents which has gone through approval procedure and is been approved. I understand after approval we cannot alter the document h

  • Is there a Premiere Pro User Group in the Detroit area?

    I'm an FCP refugee, working now with Premiere Pro via my Creative Cloud subscription. Sometimes it would be nice to connect with like-minded creatives in an earth-bound forum. Anyone in Metro Detroit in the same situation?

  • How to check if my battery is working perfect or not ?

    cycle count is 124.please help thanks

  • Sync epubs from iBooks on iPad to iphone

    I have downloaded several free epubs, from non-iBooks sources, into my iBooks on my iPad.  I now have an iPhone.  I turned 'sync iBooks collection' on on both devices but cannot get my iBooks collection sto sync. What am I doing wrong?

  • Can't open "Accounts" preferences pane

    I have a 1 week old iMac 27". When I open "System Preferences" and click on Accounts, first it says "To use the "Accounts" preferences pane, System Preferences must quit and reopen." I click OK and System Preferences opens in 32-bit and I get the mes