Finding a combination of data in several rows and on the same column

In a table I have two cloumn
ID
and
ID6 that repersent joined account that have several partners ID
for example:
ID ID6
====== ===========
11215 6100
11152 6100
11242 6101
11523 6101
11125 6101
11254 6101
there is about 60,000 rows
I have a table with several ID in a row and I need to find the missing ID6 if it exist (not all ID are join account) and put it in that row if exist
the table look like this
11523,11125,11254, 11242
11658,15662
11458
11215,11152
there is about 5,000 rows
I use plsql developer.
How do I do that ?
ELI

Solution
SELECT ID
        FROM T2
        MODEL
            RETURN UPDATED ROWS
            PARTITION BY (ROWNUM  RN)
            DIMENSION BY (0 I)
            MEASURES (ID)
            ( ID [FOR I FROM 1 TO NVL(LENGTH(REGEXP_REPLACE(ID[0],'[^,]','')),0) + 1 INCREMENT 1]
              = REGEXP_SUBSTR(ID[0],'[^,]+',1,CV(I)))
MINUS
SELECT TO_CHAR(ID) ID
FROM T1
Demo
SQL> WITH T1 AS (              SELECT 11215 ID,6100 ID6 FROM DUAL UNION ALL
  2                 SELECT 11152,6100 FROM DUAL UNION ALL
  3                 SELECT 11242,6101 FROM DUAL UNION ALL
  4                 SELECT 11523,6101 FROM DUAL UNION ALL
  5                 SELECT 11125,6101 FROM DUAL UNION ALL
  6                 SELECT 11254,6101 FROM DUAL
  7                 ), T2 AS (
  8                 SELECT '11523,11125,11254,11242' ID FROM DUAL UNION ALL
  9                 SELECT '11658,15662' FROM DUAL UNION ALL
10                 SELECT '11458' FROM DUAL UNION ALL
11                 SELECT '11215,11152' FROM DUAL
12               )
13  SELECT ID
14          FROM T2
15          MODEL
16              RETURN UPDATED ROWS
17              PARTITION BY (ROWNUM  RN)
18              DIMENSION BY (0 I)
19              MEASURES (ID)
20              ( ID [FOR I FROM 1 TO NVL(LENGTH(REGEXP_REPLACE(ID[0],'[^,]','')),0) + 1 INCREMENT
1]
21                = REGEXP_SUBSTR(ID[0],'[^,]+',1,CV(I)))
22  MINUS
23  SELECT to_char(ID) id
24  FROM T1
25  /
ID
11458
11658
15662
SQL>

Similar Messages

  • I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted!

    I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted and I can't use my computer!!

    I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
    Hope this helps.

  • Multiple selection of rows and delete the same

    hi how can we select the multiple rows in a table and delete the same.
    if i have 3 rows i have to select 2 rows and if i press the delete button the selected rows should be deleted.
    Can any one help me .
    Thanks
    Badri

    hi
    in the layout of the screen u might have dragged and dropped the table control
    double click on it u will get attributes screen in that u select MULTIPLE under Line-Selection
    under attributes tab.
    the internal table in table control must be like
    data : begin of itab occurs 0,
             empno type .......,
             empname......,
             empcity.....,
             check(1), " for tab selection"
             end of itab.
    data : itab1 like itab occurs 0 with header line.
    in the attributes screen of the table control
    pass the value ITAB-CHECK to the field W/SELECTION
    in SE51
    PBO
    Module_status_0800
    loop with control table_control_name.
    module_fill_tcontrol.
    endloop.
    PAI
    Module_user_command_0800
    loop with control table_control_name.
    module_read_tcontrol.
    endloop.
    in se38
    Module_fill_tcontrol. 
    endmodule.
    Module_read_tcontrol.
    READ TABLE itab1 INDEX control-current_line.
      IF sy-subrc EQ 0.
        MODIFY itab1 FROM itab  INDEX control-current_line.
      ELSE.
        MOVE-CORRESPONDING itab TO itab1.
        APPEND itab1.
        CLEAR itab1.
      ENDIF.
    endmodule.
    module_user_command.
    case sy-ucomm.
    WHEN 'DELE'.
          DELETE itab1 WHERE check = 'X'.
    endcase.
    endmodule.
    Regards
    Murali.M

  • How do I link fields on two different sheets? What I am trying to do is enter data on one sheet and at the same time in is entered on a second and sometimes third sheet at the same time

    PLEASE FORGIVE ME THIS IS THE FIRST TIME I AM USING THIS
    1) How do I get data entered into 2 or 3 fields on different sheets all at the same time?

    Hi David,
    Welcome to Apple Support Communities!
    In Pages, you can have several sheets in a document, and several tables on a sheet. You can link cells between tables and sheets.
    You can not link from one document to another, but who needs to?
    To link cells from Table 1 on Sheet 1 to Table 1 on sheet 2,  click on destination cell, type =, then click on the source cell. Under the Insert menu, choose Fill if you wish to duplicate a range of cells.
    This is a bit different from Microsoft Windows Excel, but you will soon get the hang of it.
    You can download the Numbers User Guide from the Help menu.
    Happy Macintoshing!
    Ian.

  • Can I paste and keep the same columns and rows?

    Paste problems. I regularly download data from the Transport for London, Oystercard website. When I used Windows I could highlight and copy on their webpage (displayed in columns and rows) and when I pasted into Excel it pasted the data in the same format (columns and rows). With iPages when I try this it pastes everything into a single downwards column. Paste and Match style does not seem to alter this just the font etc. Am I able to paste in iPages in the same format as I copy.

    I'm guessing you're using Safari to access the web site. The problem is with Safari, not Pages (no "i") or Numbers. Safari just doesn't "understand" tables in web pages & puts lots of spaces and/or returns instead of the needed tabs. I long since gave up & use Camino or FireFox for copying the tables to Numbers or any other program I want the data separated by tabs. There are some web sites, Discover Card is one, that appear to have tables but the data doesn't copy as such.

  • I dowloaded a book to itunes and i can played but when I dowloaded to mi i pod nano 6 the file is wrong i tryed several times and do the same thing :( what can i do?

    I dowloaded a book to itunes and i can play it BUT when I downloaded to my ipod it get the wrong file! I tryed deveral times and keep doing the same thing, how can i fix it? I apreciate your help.

    You may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad and restore/resync your content to it.
    If you do it via a different computer that it's not normally synced to then (from here) :
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.

  • Delete the data in several rows without deleting formulas?

    Hello, Is there a clever way to delete data on several rows at a time without also deleting the formulas or formatting in the columns?

    As far as I can tell, "data," "values," and "numbers" are all the same thing, and formulas act upon the data as necessary. I have several columns of data, then a column that figures a percentage, in currency, of the previous column. The totals for all the numbered data is added at the bottom. I found that if I delete the entire row, however, I also delete the formula. I wanted to find out how to do this quick and easy, without deleting the formula. I decided it's easier to delete just the data from the cells previous to the formula column, which leaves the formula intact. Then I must also delete the entries (data) in the rows following the formula.
    There are also occasions when I wish to move several rows down, but I found that by doing this, I also delete the formula, and it must be re-entered manually. I just wish there was a way to keep the formula intact, but apparently the only way to do that is to delete only the columns that do not contain a formula.
    Perhaps it's that I'm not familiar with spreadsheets. I've used Filemaker Pro for several years, and find it more user-friendly than Numbers.
    Thanks for your suggestion.

  • Add dynamic buttons to each report row and bind the row data to buttons specific to that row

    I have a page with a form at the top and a report at the bottom which is tied to a table. I need to add a pair of buttons for each row of the table and add dynamic actions for these buttons. I need to submit the data corresponding to the row to a REST service and refresh the table/row. I know it is possible to add ajax call and refresh the table after the response is received. But I am not sure how I can dynamically include a pair of buttons on each row and have the access the data corresponding to the record when a particular button is clicked. I was not able to find such a feature using the help page. Can you please let me know if this is possible. Thanks in advance.
    Below is the representation of how I need the page to look like.
    Col 1
    Col 2
    Col 3
    data 1
    data 21
    data 31
    Button 1
    Button 2
    data 2
    data 22
    data 32
    Button 1
    Button 2
    data 3
    data 23
    data 33
    Button 1
    Button 2
    data 4
    data 24
    data 34
    Button 1
    Button 2
    I should be able to access data 1, data21, data 31 from button 11 and button21 etc.

    select data1,
              data2,
              data3,
              null button1,
              null button2,
              rowid r_id
    from .....
    If you edit the column for button1 and navigate to the Column Formatting region you can create your button here, several different ways.  You will need to play around with how you prefer.  See below:
    <input class="button1" type="button" id="#R_ID#" value="label for the button" /> or <button id="#R_ID#">label for button</button> or you could use <a> and apply css of your theme.
    You also create both buttons in a single column.  From here you can reference any of the columns from your select by using the #COLUNMNAME# format (as I did with R_ID).
    You will next need to something similar for all columns you want to be able to grab when you click the buttons.  See below:
    --- This would be for data1 column
    <span id="D1-#R_ID#">#DATA1#</span>
    You would do these for each column that you want access to when button clicked as mentioned above.  You could bypass this step and use jquery to traverse the DOM using .closest() and .find() and give each column a distinct class.  Is is your preference.
    You would then create a dynamic action triggered when .button1 is clicked.  Now that you have that object you can get the id of the triggering object which would be your r_id and from there you can access all your individual data points(all this done in a javascript in the dynamic action) and assign to hidden items on your page.  The next step of that dynamic action you could execute pl/sql and pass those in page items.
    Hope that all makes sense.
    David
    Message was edited by: DLittle
    Just as a bit of clarification:  the r_id column does not have to be rowid, but it does need to be unique for each row return.  You could use your primary key or rownum.  Whatever works for your scenario.

  • I'd copied some pictures from a PC to a folder in Finder in my new iMac. The 'Date Created' in iMac is not the same as the 'Date Created' in the PC. Why? Is there a way to fix that?

    I'd copied some pictures from a PC to a folder in Finder in my new iMac. The 'Date Created' in iMac is not the same as the 'Date Created' in the PC. Why? Is there a way to fix that?

    View Menu -> Sort Photos is a good way to start.
    Some organising possibilities in iPhoto:
    I use Events simply as big buckets of Photos: Spring 08, July - Nov 06 are typical Events in my Library. I use keywords and Smart Albums extensively. I title the pics broadly.
    I keyword on a
    Who
    What
    Where basis (The When is in the photos's Exif metadata). I also rate the pics on a 1 - 5 star basis.
    Using this system I can find pretty much find any pic in my 50k library in a couple of seconds.
    So, for example, I have a batch of pics titled 'Seattle 08' and a  typical keywording might include: John, Anne, Landscape, mountain, trees, snow. With a rating included it's so very easy to find the best pics we took at Mount Rainier.
    File -> New Smart Album
    set it to 'All"
    title contains Seattle
    keyword is mountain
    keyword is snow
    rating is 5 stars
    Or, want a chronological album of John from birth to today?
    New Smart Album
    Keyword is John
    Set the View options to Sort By Date Ascending
    Want only the best pics?
    add Rating is greater than 4 stars
    The best thing about this system is that it's dynamic. If I add 50 more pics of John  to the Library tomorrow, as I keyword and rate them they are added to the Smart Album.
    In the end, organisation is about finding the pics. The point is to make locating that pic or batch of pics findable fast. This system works for me.

  • HT1386 my ipad won't sink; I continually get message:  itunes was unable to load data class information from Sync Services. Reconnect or try again later.  I have done both several times and still receive same messaage.

    My iPad won't sink with my computer.  I continually receive this message: "iTunes was unable to load data class information from Sync Services.  Reconnect or try again later."  I have tried this over a number of days and receive the same message.  Any suggestions??

    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
    There are some similar posts on the right side of this page (More Like This). Look at those posts.
     Cheers, Tom

  • I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and I find it very annoying.

    I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?

    . Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?
    Check, if you have the "Primary Only" option enabled. Then keywords will only be applied to the "Primary Image":
    See:                  Keywords or ratings are applied only to one of the selected images - why?
    Uncheck the little square button with the "1".

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • Can I print several different pics of the same size on one shee  of papert?

    Hi,
    I should like to print a group of several different pics of the same size & resolution on one sheet of (A4) paper eg 6 family photos. There doesn't seem to be a template for this - just two choices of format (both with one large and a few smaller format) and there is no 'Printer' pop up menu.
    I tried to laboriously copy pics to a two column works word processing document (after resizing in a different one so that they would fit in the columns). This is time consuming and when down sizing the pics lose resolution!
    Maybe I can download templates somewhere on the apple site as suggested by apple care but I couldn't find out where. Maybe there is a possibility of doing some contact prints?
    Any help much appreciated - many thanks - John

    Select the 6 photos you want printed in the iPhoto Library or Album window.
    Choose File->Print.
    In the Print dialog box, Select the paper size in the Paper popup menu.
    In the Style popup menu, select N-Up.
    In the Photos per page popup select 6.
    The preview should show what you'll get. I hope its what you wanted.
    Message was edited by: Thomas Emmerich

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • How do I combine all my calendars into one and delete the others?

    I have a work computer, a home desktop, and Apple air laptop and an 1phone 4s.
    I use Outlook calendar for all my appointments and only need one calendar.
    When I get notifications of my upcoming events on the Oulook page and on my iphone, I get multiple notifications, sometimes as many as 6 times.
    How can I combine all my calendars into one and delete the others?

    Your old account is the one you migrated, but it has been renamed because the new account had the same name. "Fixing" this is a bit complicated. It is possible to transfer data from one account to the other. See Transferring files from one User Account to another.
    A cleaner solution is to do this:
    Create a temporary new admin user account with a completely different username.
    Log into this new account.
    Delete the new account you created before migrating.
    Delete the old account you migrated that has the changed name.
    Re-migrate your old account from the Mini.
    Log into the newly migrated account and delete the temporary account.
    And, the simplest solution is to use the migrated account as-is and delete the account you originally made on the new computer.

Maybe you are looking for

  • How can I retrieve my iTunes account.

    I have a major problem that I created. my son and daughter gave me an iPad for Christmas with everything per configured. It was confusing to me with the information they used for my various passwords,E-mail address',apple ID profile and other items.

  • HELP !  my mac will not boot up

    My G4 imac 512 mb 60 HD running tiger just up and died yesterday , it had been runing slowly for a wile but i chalked that up to me running heavy RAM items like photoshop,corel painter,flash , dreamweaver ..... but then in the morning i turned it on

  • File to JDBC :Error when executing statement for table/stored proc.

    Hi, I am getting following error when i am trying to insert data into z-table using JDBC recr adapter. Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'Z

  • Multi-Person iChat Video Quality

    Hi, I am using iChat with 2 other person (so a total of 3 people in the video conferencing). What we noticed is that the audio quality remains great. But as soon as the third person joins the video chat, the video quality decrease dramatically. Any o

  • Chart Title

    I have a bar chart that prints within a group. I want the title of the chart to be based on the group value <?for-each-group:ROWSET2_ROW;./GROUP_FIELD?> <?GROUP_FIELD?> Is this possible? Where do I set the Chart title so it displays on the top of eac