Get the ROWID of lines that are not not duplicate in Oracle 10 g

Hello

given a table TAB1 in which the primary key is composed of the first 3 columns:

================================================
colA___colB___colC___colD
================================================
AA-----------------------01-----------------------20080101-----------------------100
BX-----------------------32-----------------------20050325-----------------------366
AA-----------------------01-----------------------20080102-----------------------645
AA-----------------------01-----------------------20080707-----------------------765
AB-----------------------02-----------------------20080806-----------------------336
AB-----------------------02-----------------------20080705-----------------------543

I want to be able to find the ROWID of these lines where colA | colB occurs only once in the table TAB1.

So in the example above, I would like to know the ID of the containing colA = BX line and colB = 32 as "BX32" appears only once in this table (AA01 happens 3 times, AB02 occurs twice, so I'm not interested in them).

The following does not work, but it's too SLOW:

Select the TAB1 ROWID where colA | colB = (select colA | colB of TAB1 HAVING COUNT (*) = 1).

Can someone please suggest an effective way to find this unique ROWID value in these circumstances?

Published by: Nemesis on November 29, 2008 02:50

Hi Justin:

Thank you for your support, I didn't know that the separate symbol appears. Sorry for all :)

Tags: Database

Similar Questions

  • Unable to get the preview of images that are cut and pasted from desktop folder to external hard drive.

    Original title: I imported the photos of my card SD by cutting and pasting etil worked very well but when I did the same thing to the table and stuck in the external hard drive, I can't not open images as it is said no preview.

    Only this particular file does not open and you please help u to get the photos can save that a link is missing and I don't know what.

    Hi Gregory Trinidade,

    You can try to create a folder in the C: drive and copy the images on the desktop folder C: drive.  After copy in C: drive then try again copy on external hard drive and see if it works well or not.

    Make sure that you have access to the C: drive. Also instead of cut photos copy in another location.

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to get an average displacement of the last 5 lines that were NOT NULL?

    I have a question involving a moving average, and it works fine using:

    AVG (col_x) more (partition col_a, col_b, col_c lines between 5 preceding and 1 preceding arrested)

    However, I want to change this option to give the average of the last 5 lines which were non-null.  Does anyone know how to do?

    For example:

    create table sample_table)

    col_a varchar2 (10),

    date of col_b,

    col_c number (2),

    col_x number (5.2)

    );

    insert into sample_table values ('X', trunc (sysdate), 1, 1);

    insert into sample_table values ('X', trunc (sysdate), 2, 2);

    insert into sample_table values ('X', trunc (sysdate), 3, 3);

    insert into sample_table values ('X', trunc (sysdate), 4, 4);

    insert into sample_table values ('X', trunc (sysdate), 5, 5);

    insert into sample_table values ('X', trunc (sysdate), 6, 6);

    insert into sample_table values ('X', trunc (sysdate), 7, 7);

    insert into sample_table values ('X', trunc (sysdate), 8, null);

    insert into sample_table values ('X', trunc (sysdate), 9, null);

    insert into sample_table values ('X', trunc (sysdate), 10, null);

    insert into sample_table values ('X', trunc (sysdate), 11, null);

    insert into sample_table values ('X', trunc (sysdate), 12, null);

    insert into sample_table values ('X', trunc (sysdate), 13, null);

    insert into sample_table values ('X', trunc (sysdate), 14, null);

    insert into sample_table values ('X', trunc (sysdate), 15, null);

    Select t.*,

    AVG (col_x) on myavg (partition col_a, col_b, col_c lines between 5 preceding and 1 preceding arrested)

    of sample_table t

    order by 1,2,3;

    COL_A, COL_B, COL_C MYAVG COL_X

    ---------- ----------- ----- ------- ----------

    X 15/01/2015 1 1.00

    X 15/01/2015 2 2.00 1

    X 15/01/2015 3 3.00 1.5

    X 15/01/2015 4 4,00 2

    X 15/01/2015 5 5.00 2.5

    X 15/01/2015 6 6.00 3

    X 15/01/2015 7 7.00 4

    X 15/01/2015 8 5

    X 15/01/2015 9 5.5

    15/01/2015 X 10 6

    X 15/01/2015 11 6.5

    X 15/01/2015 12 7

    15/01/2015 X 13

    15/01/2015 X 14

    X 15/01/2015 15

    15 selected lines

    What I really want is:

    COL_A, COL_B, COL_C MYAVG COL_X

    ---------- ----------- ----- ------- ----------

    X 15/01/2015 1 1.00

    X 15/01/2015 2 2.00 1

    X 15/01/2015 3 3.00 1.5

    X 15/01/2015 4 4,00 2

    X 15/01/2015 5 5.00 2.5

    X 15/01/2015 6 6.00 3

    X 15/01/2015 7 7.00 4

    X 15/01/2015 8 4

    X 15/01/2015 9 4

    X 15/01/2015 10 4

    X 15/01/2015 11 4

    X 15/01/2015 12 4

    X 15/01/2015 13 4

    X 15/01/2015 14 4

    X 15/01/2015 15 4

    15 selected lines


    concerning

    Neil

    Hello

    Here's one way:

    WITH got_avg AS

    (

    SELECT T.*

    AVG (col_x) OVER (PARTITION BY col_a, NVL2 (col_x, 1, 0)

    ORDER BY col_b, col_c

    LINES BETWEEN 5 PRECEDING

    AND 1 PRECEDING

    ) AS myavg

    OF sample_table t

    )

    SELECT col_a, col_b, col_c, col_x

    LAST_VALUE (myavg IGNORE NULLS) over (PARTITION BY col_a

    ORDER BY col_b, col_c

    ) AS myavg

    OF got_avg

    ORDER BY col_a, col_b, col_c

    ;

    Too bad, that we cannot use the IGNORE NULLS with AVG function.

  • the neutrophilia help lines that do not have a match.

    I'm having a hell of a time trying to write a select statement that would choose to specific lines without match. hurt after a sample of my table and data below.

    creating the table

    CREATE TABLE "IDEA"
      (
        "CODE"        VARCHAR2(32 BYTE),
        "ACCOUNTCODE" VARCHAR2(32 BYTE),
        "DRCR"        VARCHAR2(20 BYTE),
        "ENTRYID"     VARCHAR2(32 BYTE),
        "JOURNALAMT"  NUMBER(17,2)
      )
    
    

    data in the table.

    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172863', '6.27')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172863', '6.28')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '1115', 'CR', '172863', '-12.55')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172899', '0.25')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172899', '0.25')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172899', '197.25')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172899', '197.25')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '1115', 'CR', '172899', '-394.50')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172903', '975')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '7038', 'DR', '172903', '975')
    INSERT INTO "IDEA" (CODE, ACCOUNTCODE, DRCR, ENTRYID, JOURNALAMT) VALUES ('Company', '1115', 'CR', '172903', '-1950')
    
    

    When I run the following query I have that would get the following result

    select
        --DRCR,
        ENTRYID,
        sum(JOURNALAMT)
       
    From idea
    group by entryid
    
    

    my top of the query output.

    "ENTRYID"                     "SUM(JOURNALAMT)"             
    "172863"                      "0"                           
    "172899"                      "0.5"                         
    "172903"                      "0"                          
    

    I want to identify the lines that make up the 50.

    Please note that there might be 3 or 4 lines per credit. so it could be a football match of the 4DR same 5DR or 1 CR 1 CR however will always be 1 CR.

    I thought to write a plsql program that would try to match every single possible combination for 1 credit, but it seems to me that there is an easier way.

    any help would be grateful.

    Hello

    Here is a function that attempts to find a combination of 'DR' ranks with the entry ID given, whose journalamts correspond exactly to the amount given.  If If is such a combination, it returns a string that contains a list delimited by amounts.  You coould easily change this to return a list delimited by primary keys, or whatever you want:

    FUNCTION to CREATE or REPLACE dr_list
    (entryid_wanted IN idea.entryid%TYPE
    journalamt_wanted in NUMBERS
    prev_rowid IN DEFAULT NULL ROWID
    )
    RETURN VARCHAR2
    IS
    "failure_message VARCHAR2 (50): = '(aucune correspondance trouvée);
    remainder_list VARCHAR2 (4000);
    return_list VARCHAR2 (4000);
    BEGIN
    IF journalamt_wanted > 0
    THEN
    return_list: = failure_message;   -Are likely to be replaced later

    -Find each line that may be part of a solution
    FOR (IN) r
    SELECT journalamt
    R_id AS ROWID
    The IDEA
    WHERE Drcr = "DR".
    AND entryid = entryid_wanted
    AND journalamt > 0 - if necessary
    LNNVL (ROWID, AND<=>
    ORDER BY ROWID
    )
    LOOP
    IF r.journalamt = journalamt_wanted
    SO - This line is a solution alone
    return_list: = r.journalamt;
    EXIT;
    On the OTHER - see if this line belongs to a bigger solution
    remainder_list: = dr_list (entryid_wanted
    , journalamt_wanted - r.journalamt
    r.r_id
    );
    IF remainder_list <> failure_message
    THEN
    return_list: = r.journalamt | ', ' || remainder_list;
    EXIT;
    END IF;
    END IF;
    END LOOP;
    END IF;

    RETURN return_list;
    END dr_list;
    /

    You can use the function in a query like this:

    SELECT EntryID

    SUM (journalamt) AS total_amt

    , dr_list (entryid, SUM (journalamt)) AS extra_drs

    The IDEA

    GROUP BY entryid

    ;

    and it could produce an output like this:

    ENTRYID TOTAL_AMT EXTRA_DRS
    ---------- ---------- ------------------------------
    172903 0
    172863 0
    172899.5.25,.25
    8 987 (no match)
    901 5 2, 2, 1

    Note that when you call the function, pass you the arguemnts only 2.  The 3rd argument is used only by the function when it calls itself.

  • Screening of lines that are not equal

    PL/SQL version I use is 11.1.0.7.0

    This is sample data

    Station of Seq ID Date
    __ ____ __ ______
    1 3/21 / 2012-12-1206
    1 2/28 / 2012 24 1712
    1 2/12 / 2012 20 1105

    2 3/20 / 2012 45 1206
    2 2/26 / 2012 46 1206
    2 2/22 / 2012 47 1206

    3 3/25 / 10 / 2012 1206
    3 2/18 / 12 / 2012-1105

    4 4/21 / 2012-22-1105
    4 4/20 / 2012 23 1105
    4 2/16 / 2012 24 1105
    4 2/16 / 2012 26 1105

    The date for each Id is required, but only if the station code is the same for all records, if not ignore all records.

    The expected result are
    Station of Seq ID Date
    __ ____ __ ______

    2 3/20 / 2012 45 1206
    4 4/21 / 2012-22-1105

    Thank you
    Paul
    SQL> select  *
      2    from  tbl
      3  /
    
       ID DT               SEQ    STATION
    ----- --------- ---------- ----------
        1 21-MAR-12         12       1206
        1 28-FEB-12         24       1712
        1 12-FEB-12         20       1105
        2 20-MAR-12         45       1206
        2 26-FEB-12         46       1206
        2 22-FEB-12         47       1206
        3 25-MAR-12         10       1206
        3 18-FEB-12         12       1105
        4 21-APR-12         22       1105
        4 20-APR-12         23       1105
        4 16-FEB-12         24       1105
    
       ID DT               SEQ    STATION
    ----- --------- ---------- ----------
        4 16-FEB-12         26       1105
    
    12 rows selected.
    
    SQL> with t as (
      2             select  tbl.*,
      3                     count(distinct(station)) over(partition by id) cnt
      4               from  tbl
      5            )
      6  select  id,
      7          max(dt)
      8    from  t
      9    where cnt = 1
     10    group by id
     11    order by id
     12  /
    
       ID MAX(DT)
    ----- ---------
        2 20-MAR-12
        4 21-APR-12
    
    SQL> 
    

    SY.

    Published by: Solomon Yakobson on 29 January 2013 13:56

  • How do you get the bulleted list lines that frame overflow to indent properly?

    Hi all

    How to configure InDesign to automatically indent bulleted lines that overflow the text frame.

    indent.png

    Thank you

    Add the amount of the withdrawals to the left that you want and then add a hanging indent by the same amount to the first line in the paragraph style

  • Display the content of images that are not on the page

    I have some images containing the photos I would like to move out of the page completely while I rearrange accordingly. The problem is that I see then is not the content of the framework. How can I activate the visualization of images that have been moved out of the page content?

    You're in preview mode. With no text active cursor hit W or use the mode button on the bottom of the box tools, or lifetime the view menu to switch back to the normal display.

  • applications in the list of downloads that are not (2.1)

    When I look at an application downloaded with

    Settings > Applications > manage Applications

    I see two who do not belong (the filter is set on downloaded): com.android.gallery and com.android.inputmethod.latin

    If I go the market app and view the downloaded applications do they not appear. I know that they are part of the android os, but it's annoying to have in the list of downloaded applications. Is it possible to get them off the coast of this list? I tried to reboot the device. And it happened when I got the 2.1 update.

    IM willing to bet that they are older applications which replaced with the update. I uninstalled both on my phone and have not had a problem. I think it's the old Gallery and an old file entry for the keyboard or maybe text-to-speech or something. Whatever it is, I uninstalled them and haven't seen any problems based on my Droid, or any of my applications. I hope this helps.

  • Firefox 4 for MAC: How can I sort the bookmarks by name that are not in the files?

    Solution in site and forum, Firefox does not work on Firefox 4 for Mac, i.e. Control View-Sidebar-bookmarks, etc.

    All the Favorites are in folders.

    • The Bookmarks Toolbar folder stores the bookmarks that you see on the (view > toolbars >) Bookmarks Toolbar.
    • The bookmarks Menu folder stores the bookmarks that you see in the menu bookmarks and create via ' bookmarks > bookmark this Page "or" bookmark this link "in the context menu.
    • The Unsorted Bookmarks folder stores which inserts created bookmarks by clicking on the star on the right end of the address bar.

    You can right click on a such main folder (root) to sort the bookmarks in that folder.

    You may need on Mac:

  • Getting the error "URI index 0 is not valid" in Oracle Service Bus

    Dear friends,

    I get an error "URI index 0 is invalid" during the execution of customization files in Oracle Service Bus. I am not able to understand why it's happening. Help, please.

    Thank you.

    Kind regards
    Palak Mathur

    Change the:

    
    
    http://app-1ip-alsb-01.corp.intranet/ServiceAddressV1Proxy
    1
    
    
    

    Section of:

    
     
              http://app-1ip-alsb-01.corp.intranet/ServiceAddressV1Proxy
              1
            
    
    

    in your customization file and try again.

  • Lines that do not migrated because of filters are saved somewhere?

    Hi all

    According to my understanding, if I put a constraint on the target table in the models and use the control flow through a seam in the interface, the lines that do not meet the constraint get connected to the table of errors E$.

    I want to know that if I put some filters or join conditions on the source, the lines that are not migrated because of these filters, do they get connected anywhere. Until now, I used to check tables $ ca and my source and see that all lines have not migrate but is there any other table where the journal is maintained?

    Thank you and best regards,
    Prerna

    Hey Loren,
    You cannt see these documents. You must look in the backend... Let's say you have a filter SAL > 100 then you will get all information abot SAL<100. if="" you="" need,="" then="" you="" create="" one="" refresh="" variable="" based="" on=""><100 and="" get="" the="" count(*)="" or="" other="" possible="" information="" as="" per="">

    Bottom line: ODI will occupy on those records satisfying the condition not others.

    Thank you.
    http://bhabaniranjan.com/

  • Smartphones blackBerry [9700 "Bold"] how to get emails that are not gmail, yahoo,...?

    Hi guys,.

    I saw a small company and goes to buy a Blackberry Bold 9700. I read a lot of forums and boards, but I have still not found an answer to the question: "is it possible to get e-mails from accounts that are not google or yahoo etc."?

    I have a clean online store or the domain and so my email address is something like info @.com

    I am currently using Thunderbird on my laptop to get and send e-mails via pop3/smtp.

    So, it is possible to have access to e-mail via a pop3 server and send emails using smtp on a Blackberry 9700 Bold?

    Greetings,

    Marco.

    Yes, you can access most of the protocols POP3 or IMAP mail server.

  • How to find computers that are not on the domain in an Active Directory forest.

    Hello

    I'm looking for a tool that can scan a subnet and give me the list of computers that are not on the field, but connected to the network. My company has recently spent a lot of users of the task force to the area, but there is a population of users who are unwilling to join the domain and still using the local administrator to log on to the computer.

    These computers do not meet the domain policies applied and causing many problems with the network and other systems on the field.

    Help, please.

    concerning

    Syed M. Uzair

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

  • How to make the color of ScrollBar that are created using the css code is displayed in Windows 8

    I wish I could understand how to get the color of ScrollBar that are created using the css code appears on my web design theme games. But I can't see them in Windows 8. Is there something that I need to enable to see colorful scroll bars? I'm used to be able to see them on my Windows XP computer. It is important for me because a lot of people like models with colorful scroll bars.

    Open the Tools menu and turn on "Compatibility view" to do.  Note that this works only in the desktop version of Microsoft Internet Explorer.

  • get rid of lines that are completely understood by the other lines

    using oracle 10 g

    I have a requirement where I have a few groups that have a start date and end date, and
    I don't know how many lines per group, it is dynamic.

    I need to get rid of all the lines that are completely understood by the other lines per group
    To tell if an online group has started on January 1, 2000 and ending on January 1, 2001
    and another group line begins February 1, 2000 and ends at 2000 1 dec
    only the line Jan to Jan should appear.

    so, for
    with t as
    (
        select 'A' grp, 1 id, to_date('01-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-01-2001', 'MM-DD-YYYY') end_dt from dual union all
        select 'A' grp, 2 id, to_date('02-01-2000', 'MM-DD-YYYY') start_dt, to_date('12-01-2000', 'MM-DD-YYYY') end_dt from dual union all
        select 'A' grp, 3 id, to_date('03-01-2000', 'MM-DD-YYYY') start_dt, to_date('12-10-2000', 'MM-DD-YYYY') end_dt from dual union all
        select 'A' grp, 4 id, to_date('07-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-10-2001', 'MM-DD-YYYY') end_dt from dual union all
        select 'A' grp, 5 id, to_date('01-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-01-2001', 'MM-DD-YYYY') end_dt from dual 
     )
    I don't want to see
    GRP,ID,START_DT,END_DT
    A,1,1/1/2000,1/1/2001
    A,4,7/1/2000,1/10/2001
    Published by: pollywog on July 20, 2010 11:49

    Published by: pollywog on July 20, 2010 11:56

    Published by: pollywog on July 20, 2010 11:56

    Well, I do not get the exact release you do, but I'm sure that this complies with your verbal condition.

    You may have a fault in your output specified? It is also quite possible, that there is something wrong with my query :)

    with
       t as
    (
       select 'A' grp, 1 id, to_date('01-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-01-2001', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 2 id, to_date('02-01-2000', 'MM-DD-YYYY') start_dt, to_date('12-01-2000', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 3 id, to_date('03-01-2000', 'MM-DD-YYYY') start_dt, to_date('12-10-2000', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 4 id, to_date('07-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-10-2001', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 5 id, to_date('01-01-2000', 'MM-DD-YYYY') start_dt, to_date('01-01-2001', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 6 id ,to_date('12-25-1999', 'MM-DD-YYYY') start_dt, to_date('01-05-2001', 'MM-DD-YYYY') end_dt from dual union all
       select 'A' grp, 7 id, to_date('02-01-2001', 'MM-DD-YYYY') start_dt, to_date('02-01-2001', 'MM-DD-YYYY') end_dt from dual
    )
    select
       grp,
       id,
       start_dt,
       end_dt,
       last_start_dt,
       last_end_dt
    from
    (
       select
          lag(start_dt)   over (partition by grp order by start_dt asc)  as last_start_dt,
          lag(end_dt)     over (partition by grp order by start_dt asc)  as last_end_dt,
          grp,
          id,
          start_dt,
          end_dt
       from
          t
    )
    where last_start_dt is null
    or
    not
    (
             start_dt  between last_start_dt and last_end_dt
       and   end_dt    between last_start_dt and last_end_dt
    )
    order by start_dt asc;
    
    G                 ID START_DT             END_DT               LAST_START_DT        LAST_END_DT
    - ------------------ -------------------- -------------------- -------------------- --------------------
    A                  6 25-DEC-1999 12 00:00 05-JAN-2001 12 00:00
    A                  3 01-MAR-2000 12 00:00 10-DEC-2000 12 00:00 01-FEB-2000 12 00:00 01-DEC-2000 12 00:00
    A                  4 01-JUL-2000 12 00:00 10-JAN-2001 12 00:00 01-MAR-2000 12 00:00 10-DEC-2000 12 00:00
    A                  7 01-FEB-2001 12 00:00 01-FEB-2001 12 00:00 01-JUL-2000 12 00:00 10-JAN-2001 12 00:00
    
    4 rows selected.
    

Maybe you are looking for

  • Camileo H20 - registered file types

    Hello to all on the forum! : D I will be short and explain my problem: I bought a Camileo H20 in the month of August, which would eventually be sent back cause in 1080 p resolution, you could see a white pixel... This camera recorded videos. MOV file

  • The partition hidden Satellite A120 restore to factory settings?

    HelloThe said user manual I press F8 during startup, the windows repair chose and then full recovery from a hidden partition. In fact I'm invited to restore backups, I already did on the indicated partition (data). I can't find how to restore the fac

  • "Sweep left" does not work for some email notifications

    On some mail notifications, as documented works "sweep left" very well, but I'm still not clear what if any difference there is between 'X' and 'Clear' (see previous announcement) - I have recently several contradictory theories.  However, for SOME e

  • How to convert BCD decimal series.

    Hello all, probably a stupid question. I have format timestamp in the BCD data from port series , which I want to convert to display in the form of timestamp based LV. I spent almost 4-5 hours trying to figure out how do - probably my brain froze now

  • FS7610 error creating cluster NAS

    I have one Equallogic FS7610 I am trying to add to my Equallogic Group Manager. It is all fresh out of the box, so I don't have my client network and DNS to the top yet.  I do see the unit and start the wizard to configure.  I can't seem to put in al