Outer join to find the missing?

I have 2 tables:

with stud_courses as
(
Select studentid 111, 2, 2201 coursecategory courseid, 'A' GRADE of double
Union
Select studentid 111, 2, 2203 coursecategory courseid, CATEGORY "B" of the double
Union
Select studentid 111, 4 coursecategory, 2121 courseid, 'A' GRADE of double
Union
Select studentid 222, 3 coursecategory, 1111 courseid, 'A' GRADE of double
Union
Select studentid 222, 3 coursecategory, 1112 courseid, 'A' GRADE of double
)
course_categories as
(
Select 2 coursecategory, 2201 courseid double
Union
Select 2 coursecategory, 2202 courseid double
Union
Select 2 coursecategory, 2203 courseid double
Union
Select 2 coursecategory, 2204 courseid double
Union
Select 3, 1110 coursecategory courseid double
Union
Select 3 coursecategory, 1111 courseid double
Union
Select 3 coursecategory, 1112 courseid double
Union
Select 3 coursecategory, 1113 courseid double
Union
Select 4 coursecategory, 2120 courseid double
Union
Select 4 coursecategory, 2121 courseid double
Union
Select 4 coursecategory, 2122 courseid double
Union
Select 4 coursecategory, 2123 courseid double
)

For each student, wants to add the missing courseids for the coursecategory he takes. So student because 111 is in coursecategory 2 I should be able to show all results for him, including the ID of course 2202 and 2204 of category 2 and 2120, 2122, 2123 for this child

My end result would be something like:

StudentID, courseid, coursecategory, grade
111,2,2201, "A".
111,2,2201, '
111,2,2203, 'B '.
111,2,2201, '
111,4,2120, '
111,4,2121, "A".
111,4,2122, '
111,4,2123, '
222,3,1110, '
222,3,1111, "A".
222,3,1112, "A".
222,3,1113, '

I know how to do it with a Union and not exists, but I was wondering if I could do it with an outer join.

I would appreciate your help.

Thank you

Hello

Yes, you can do it with an outer join. The tricky thing is you need outside to join the table real stud_courses to something that has valid all combinations of the studnents and prices. There is no single table that contains it; the following query will receive these combinations by making a cross join:

WITH     all_students     AS
(
     SELECT DISTINCT     studentid
     FROM          stud_courses
)
,     got_category_cnt     AS
(
     SELECT     all_s.studentid
     ,     c.coursecategory
     ,     c.courseid
     ,     NVL ( s.grade
              , 'M'
              )               AS grade
     ,     COUNT (s.grade) OVER ( PARTITION BY  all_s.studentid
                                 ,          c.coursecategory
                         )      AS category_cnt
     FROM           all_students         all_s
     CROSS JOIN      course_categories  c
     LEFT OUTER JOIN      stud_courses         s  ON    s.studentid     = all_s.studentid
                                         AND   s.courseid          = c.courseid
)
SELECT       studentid
,       coursecategory
,       courseid
,       grade
FROM       got_category_cnt
WHERE       category_cnt     > 0
ORDER BY  studentid
,       coursecategory
,       courseid
,       grade
;

The results I get are:

`STUDENTID COURSECATEGORY   COURSEID G
---------- -------------- ---------- -
       111              2       2201 A
       111              2       2202 M
       111              2       2203 B
       111              2       2204 M
       111              4       2120 M
       111              4       2121 A
       111              4       2122 M
       111              4       2123 M
       222              3       1110 M
       222              3       1111 A
       222              3       1112 A
       222              3       1113 M

These are a little different from what you have posted.

user9207291 wrote:
...
StudentID, courseid, coursecategory, grade
111,2,2201, "A".
111,2,2201, '
111,2,2203, 'B '.
111,2,2201, '
111,4,2120, '
111,4,2121, "A".
111,4,2122, '
111,4,2123, '
222,3,1110, '
222,3,1111, "A".
222,3,1112, "A".
222,3,1113, '

Is it because there are errors in what you posted? Do you really want to have three lines of output for the same studentid (111) and courseid (2201)?

Looks like there should be a slick way to do this with a partitioned outer join.
A partitioned outer join matches each row of table A with the lines in table B, but, if there is no correspondence between a given A line and a line to a given partition of B, that the rank of A and the B partition is included in the game anyway. Here, we want the two partition tables.

Tags: Database

Similar Questions

  • Find the missing series or page n

    I have a table

    document_sl_no, from_page, book_no, to_page

    1                              1          1               9

    2                              1          10             12

    3                              1          18              33

    Documents binded in the books and the Livre_No is entered in the database, so that if we find the hard copy of the document we can search easily.

    I need to write a query that miss me page in the pagination sequence book will give.

    as in the above example page No 13,14,15,16,17 are missing.

    Y at - it no way out.

    I was tring to get the sequence first then thought to find the missing sequence using advance or delay.

    So any suggestions to get the sequence of this wise Livre_No table

    Livre_No page_no

    11
    12
    13
    14
    15
    16
    17
    18
    19
    110
    111
    112
    118
    119
    120
    121
    122

    Something like this:

    books (book_no, from_page, to_page) as)
    Select 1,1,9 from all the double union
    Select 1,10,12 from all the double union
    Select double 1,18,33
    )
    run like)
    Select
    Livre_No
    from_page
    to_page
    , (from_page, 1, to_page) ahead of (Livre_No order of from_page partition)
    -to_page diff
    books
    )

    Select
    Livre_No
    from_page
    to_page
    , case when diff > 2 then
    diff-1 | "the missing pages after" | to_page
    lack of end
    leaks

    BOOK_NO FROM_PAGE TO_PAGE MISSING
    1 1 9 -
    1 10 12 5 missing pages after 12
    1 18 33 -
  • I'm unable to find the missing drivers on my device manager.

    OT: Re: lack of pilots.

    Hello

    I'm unable to find the missing drivers on my device manager. A unknown device watch. Other shows, like in the storage controllers. I checked Windows update, but it does not find the missing drivers. I don't have the drivers on my CD.

    Please download and run the display driver and download a copy of the report he produced on your OneDrive. To obtain a report all drivers Select Edition, select all followed by file, save selected items.
    http://www.NirSoft.NET/utils/DriverView.html

    Please provide a copy of your system information file. Type the system information in the search box above the Start button and press the ENTER key (alternative is select Start, all programs, accessories, System Tools, system information). Select file, Export and give the file a name noting where it is located. Not to place the cursor in the body of the report before exporting the file. The system creates a new information file system each time system information is available. You must allow a minute or two before the file is completely filled before exporting a copy. Please download the file to your OneDrive, to share with everyone and post a link here. Normal mode preferred report. Please say if the report was obtained in safe mode. The request for a copy of this file is additional to answer the question about the brand and the model. If the report is in one language other than English, please indicate the language.

    For assistance OneDrive see paragraph 9.3

    http://www.gerryscomputertips.co.UK/MicrosoftCommunity1.htm

  • Find the missing numbers

    I want to find the missing of a column that is alphanumeric numbers, its last five positions are digital. In the first three places there are different combinations of alphas that is * 'BA', 'BAW","SA","SAA"... * If alphas are two then 3rd position is empty. I also need to generalize this to cover all digital series existing alpha.
    SELECT SUBSTR (a.claim_no, 4, 5) + 1
      FROM core_business.cb_pensioner a
     WHERE SUBSTR (a.claim_no, 1, 3) = 'BA '
       AND NOT EXISTS (
                     SELECT NULL
                       FROM core_business.cb_pensioner b
                      WHERE to_number(SUBSTR (b.claim_no, 4, 5)) =  to_number(SUBSTR (a.claim_no, 4, 5)) + 1) 
       order by SUBSTR (a.claim_no, 4, 5);
    I get the error ORA-01722

    You have two problems with this task.

    1 problem is how to convert a number from the back so that you can compare the values.

    to_number(SUBSTR (b.claim_no, 4, 5)) 
    

    works, but only if the b.claim_no value is always a number regardless of the other criteria of the column.

    Such an assertion

    ...
    WHERE SUBSTR (a.claim_no, 1, 3) = 'BA ' /* filter 1 */
    and to_number(SUBSTR (b.claim_no, 4, 5)) > 1 /* filter 2 */
    ...
    

    may fail because your table can have value as

    b.claimno = "XYZ1234b".

    The way you wrote the query of the database will decide what filter criteria, it first runs. It could be filter1, but could also be filter2. If filter2 is executed first, you will get the error message.

    Problem 2 how to order and compare different lines, so that you can find the missing values.

    Here the analytical function of the LEAD (LAG) is very useful. It gives you access to the next (or previous row).

    Both problems can be overcome.

    Here is my test, but I don't know if it works in your case. You may have to adapt a little.
    This should work if all lines are digital which belong to specific groups. If you have too much data incorrect in there, then a different approach is necessary.

    with testdata as (select 'XYZ1234b' claim_no from dual union all
                select 'BA 12345' claim_no from dual union all
                select 'BA 12346' claim_no from dual union all
                select 'BA 12350' claim_no from dual union all
                select 'BAW11111' claim_no from dual union all
                select 'BAW11113' claim_no from dual union all
                select 'XYZ1234b' claim_no from dual )
    /* end of test data creation */
    select claim_no, substr(claim_no, 1,3) part1, substr(claim_no, 4) part2,
           to_number(substr(claim_no, 4)) current_num,
           lead(to_number(substr(claim_no, 4))) over (partition by substr(claim_no, 1,3) order by to_number(substr(claim_no, 4))) next_num,
           lead(to_number(substr(claim_no, 4))) over (partition by substr(claim_no, 1,3) order by to_number(substr(claim_no, 4)))
            - 1 - to_number(substr(claim_no, 4))
            as "missing_values"
    from testdata
    where substr(claim_no, 1,3) in ('BAW','BA ')
    order by claim_no;
    
    CLAIM_NO PAR PART2 CURRENT_NUM   NEXT_NUM missing_values
    -------- --- ----- ----------- ---------- --------------
    BA 12345 BA  12345       12345      12346              0
    BA 12346 BA  12346       12346      12350              3
    BA 12350 BA  12350       12350
    BAW11111 BAW 11111       11111      11113              1
    BAW11113 BAW 11113       11113
    

    1 problem is solved because where condition is always executed before the function in the select clause, in particular in the context of an analytic function.
    Problem 2 is also solved by using the analytical function, function LEAD. And it's fast, because you access the same table only once. Another solution could be a subquery to extract the value of the next line. This means that multiple access to the same table and is usually much slower.

    Published by: W. Sven 20 Sep, 2010 14:32

  • How can I find the missing e-mails Outlook Express6

    All messages in the Inbox disappears from 13/04.I I receive all messages from 14/04.Please someone help me find my old emails.

    Just to elaborate on the correct assessment of Steve.

    Two reasons the most common for what you describe is disruption of the compacting process, (never touch anything until it's finished), or bloated folders. More about that below.

    Why OE insists on compacting folders when I close it? :
    http://www.insideoe.com/FAQs/why.htm#compact
     
    Why mail disappears:
    http://www.insideoe.com/problems/bugs.htm#mailgone
     
    About file Corruption:
    http://www.Microsoft.com/Windows/IE/community/columns/filecorruption.mspx

    Recovery methods:

    If you use XP/SP2 or SP3, and are fully patched, then you should have a backup of your dbx files in the Recycle Bin (or possibly the message store), copied as bak files.

    To restore a folder bak on the message store folder, first find the location of the message store.

    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.

    In Windows XP, the .dbx files are by default marked as hidden. To view these files in the Solution Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.

    Close OE and in Windows Explorer, click on the dbx to the file missing or empty file, then drag it to the desktop. It can be deleted later once you have successfully restored the bak file. Minimize the message store.

    Open OE and, if the folder is missing, create a folder with the * exact * same name as the bak file you want to restore but without the .bak. For example: If the file is Saved.bak, the new folder should be named saved. Open the new folder, and then close OE. If the folder is there, but just empty, continue to the next step.

    First of all, check if there is a bak file already in the message. If there is, and you have removed the dbx file, go ahead and rename it in dbx.

    If it is not already in the message, open the trash and do a right-click on the file bak for the folder in question and click on restore. Open the message store up and replace the .bak by .dbx file extension. Close the message store and open OE. Messages must be in the folder.

    If messages are restored successfully, you can go ahead and delete the old dbx file that you moved to the desktop.
     
    If you have not then bak copies of your dbx files in the Recycle Bin:

    DBXpress run in extract disc Mode is the best chance to recover messages:
    http://www.oehelp.com/DBXpress/default.aspx

    And see:
    http://www.oehelp.com/OETips.aspx#4

    A general warning to help avoid this in the future:

    Do not archive mail in default OE folders. They finally are damaged. Create your own folders defined by the user for mail storage and move your mail to them. Empty the deleted items folder regularly. Keep user created folders under 300 MB, and also empty as is possible to default folders.

    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3

    And backup often.

    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx

  • Find the missing documents and insert accordingly

    Oracle version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    Hello gurus

    I'm really grateful if someone would help out me. Thanks in advance

    Examples of data

    Drop, the creating and inserting in tables

    drop table TYPE_MST;
    drop table TYPE_VERSION;

    -------------------------
    Create Tables:

    create the table TYPE_MST
    (
    Type_desc varchar2 (15)
    );

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

    Table insert

    insert into TYPE_MST
    (
    Select 'First' double
    Union of all the
    Select 'Second' double
    Union of all the
    Select 'Third' double
    );

    --------
    create the table TYPE_VERSION
    (
    TYPE_DESC varchar2 (15).
    MIN_AGE number (5),
    MAX_AGE number (5),
    VERSION_ID number (5)
    );
    ---------
    insert into TYPE_VERSION
    (
    Select 'First', 0, 5, 100 double
    Union of all the
    Select 'First', 5, 10, 100 double
    Union of all the
    Select 'First', 11,15, 100 double
    );

    ---------

    Queries against existing data
    Select * from TYPE_VERSION;

    The query result

    TYPE_DESC, MIN_AGE, MAX_AGE, VERSION_ID

    First                      0                5               100

    First                      5                10             100

    First                      11              15             100

    My requirement is that system automatically inserts type_desc missing in TYPE_VERSION.

    For example, we have 3 Type_Desc, first, second, third, but in the TYPE_VERSION table, we have data available for only 1 Type_Desc who is "First", this system should insert the missing data in this table using existing data.

    I need result something like below:

    Required result

    TYPE_DESC, MIN_AGE, MAX_AGE, VERSION_ID

    First                      0                5               100

    First                      5                10             100

    First                      11              15             100

    Second 11 15 100

    Second                   5                10             100

    Second 11 15 100

    Third                    0                5               100

    Third                     5                10             100

    Third 11 15 100

    Thanks in advance

    Concerning

    Shu

    Hello

    It is still not clear what you want.

    That's what you want for the examples you gave:

    MERGE INTO dst type_version

    WITH THE HELP OF)

    SELECT DISTINCT

    m.type_desc

    v.min_age, v.max_age, v.version_id

    OF type_mst m

    CROSS JOIN type_version v

    )                  src

    WE (dst.type_desc = src.type_desc

    AND dst.min_age = SRC. MIN_AGE

    )

    WHEN NOT MATCHED THEN INSERT

    (dst.min_age, dst.max_age, dst.type_desc, dst.version_id)

    VALUES (src.min_age, src.max_age, src.type_desc, src.version_id)

    ;

    If she's going to do what you want in general depends on what you want in general.  As long as I don't know the General rules you want to set up, I don't know if it makes them or not.

    This does not seem a very good design.  Why do you need a table with all possible combinations?  Sounds like you're saying, for example, if 2 lines have the same value of min_age, then have the same values for max_age and version_id, too.  This 3rd Normal violares form.  Why not have a table with the possible values for min_age max_age version_id, and simply join cross which type_mst when you need to see all possible combinations?

  • Find the missing values in the third from the two other tables table

    Hi - I tried to do it myself, but the answer escapes me. Can someone tell me please in a sense better? We have a project_categories with project_IDs and category_IDs related project table. We have another contact_categories with contact_IDs and related category_IDs contact table. We use these two tables to link contacts with the projects at least a stuff. It works well for e-mail notifications. We have a third table to 'pay' who are interested in specific projects. The hold table has contact_IDs and project_IDs related. I want to find contacts who have expressed interest in a project, by inserting a row in the table of the licensee, but they did not choose the project categories in the contact categories. It would be an exceptionally rare exception, so the test I added myself as 100010 contact as a 'holder' project, but deliberately do not have related project selected in the categories contact categories.

    Select cc.category_id, ph.contact_id, ph.project_id, pc.category_id
    of purchasing_planholder ph, purchasing_project_categories pc, purchasing_contact_categories cc
    where ph.project_id = pc.project_id
    and ph.contact_id = cc.contact_id
    and ph.contact_id. Ph.project_id | CC.category_id
    not in (select ph.contact_id |) PC.project_id | PC.category_id
    of purchasing_planholder ph, purchasing_project_categories pc, purchasing_contact_categories cc
    where ph.project_id = pc.project_id
    and ph.contact_id = cc.contact_id)
    and ph.contact_id = 100010

    It gives me every category for the touch test and each category for the project. I want to find contacts in the table of holders who have not selected the categories related to the specific project they selected in the table of the licensee. I tried less, outer joins, etc. This requires it PL/SQL and a temporary table, or can I find exceptions with a report? Or do I need a different approach? The ideal response would display a line with the contact_ID and the project, where the contact has not selected project categories. This would serve to inform them that they must select at least one of the categories project on the contact form. Thanks for any comments.

    Peter

    CONTACT_ID PROJECT STUFF STUFF
    ---------------------- ---------------------- ---------------------- ----------------------
    100010 701 1 19
    100010 701 1 18
    100010 701 16 19
    100010 701 16 18
    100010 701 21 19
    100010 701 21 18
    100010 701 24 19
    100010 701 24 18
    8 selected lines

    Hi user,

    When you post a Question in the Forum, please be clear entries must be given, the expected results and the tests you do,
    the errors/results that is facing you.

    Also, see this link to BluShadow.

    SQL and PL/SQL FAQ

    Please attach the query or programs in the code tags for code formatting.

    Just try something like that,

    SELECT *
      FROM emp c
     WHERE NOT EXISTS (SELECT *
                         FROM emp a
                        WHERE EXISTS (SELECT *
                                        FROM emp b
                                       WHERE a.empno = b.empno));
    

    In the inner query, the verified conditon is same empno in the tables and for example, some lines are obtained, other than
    train all results of the outer query.

    In the above case, no rows are returned.

    Thank you
    Shankar

  • two of my sent files are missing from windows mail, and I am unable to trace it? Please let me know how to find the missing folder

    Until a few days back all sent files has been noticed but suddenly two of the sent files are missing and I am unable to find the same.  I use vista and windows mail.  Please let me know how recover/find missing files.

    Thank you
    Mahesh

    Try searching *.eml and make sure you include hidden files and folders in the search parameters.  See also here for the Organization of store message (www.oehelp.com/backup.aspx#wm).  You should be able to use the browser to go to the directory of sent items under the directory of local records and the actual messages will be located there.  It may be useful to compact and repair the database (see www.oehelp.com/WMUTil/) and make sure that everything in the folder, you saw the value. Current view | Show all messages.

    Steve

  • Oracle: Use LEFT OUTER JOIN, but convert the data to an external list

    Hello, all,.

    I know it can be done; I just don't remember how I got it done, oh there are so many years.

    Assumes that the tables exist for groups and individuals.  People can belong to several groups.

    SELECT g.groupName, p.lastName || ', ' || p.firstName as fullName
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON gpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    ORDER BY g.groupName, fullName
    

    This gives us:

    Group One          Alpha, Daniel
    Group One          Bravo, Charles
    Group One          Charlie, Chuck
    Group Two          Beta, Alpha
    Group Two          Delta, Bonnie
    Group Three        Echo, Bunny
    Group Three        Golf, Samuel
    Group Three        November, Stan
    

    How word the SQL to get the data as:

    Group One          Alpha, Daniel | Bravo, Charles | Charlie, Chuck
    Group Two          Beta, Alpha | Delta, Bonnie
    Group Three        Echo, Bunny | Golf, Samuel | November, Stan
    

    V/r,

    ^_^

    I finally thought to it.  I was using incorrect keywords on Google.

    SELECT g.groupName, LISTAGG(p.lastName || ', ' || p.firstName,' | ') WITHIN GROUP (ORDER BY g.groupName) "fullName"
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON ggpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    GROUP BY g.groupName
    ORDER BY g.groupName, fullName  
    

    Just in case someone else is going through this same desire.

    HTH,

    ^_^

  • Outer join - problem with the name of the table in the select list

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    create table (j1)

    number of C1,

    number of C2);

    create table (j2)

    number of C1,

    number of C2);

    insert into values j1 (1, 10);

    insert into j1 values (1, 100);

    insert into values j1 (1, 1000);

    insert into values j2 (1, 2);

    insert into values j2 (1, 4);

    insert into values j2 (1, 8);

    commit;

    Select c1, j1.c2, j2.c2 of outer join of j1 j2 using (c1); - DOES NOT

    Select c1, j1 j2 (c1) using outer join j2.c2. - WORK

    Why?

    Hello

    Interesting question!  Oracle goes very far in trying not to trigger an error.

    The OUTER keyword (if used; it is always optional) must be preceded by one of the keywords, right or LEFT.  Since neither LEFT, RIGHT, or FULL comes before OUTER in queries in your first message, it does not recognize as keyword OUTER and treats him like a table alias for table j1.  Since j1 has an alias, the real table name cannot be used in the SELECT clause.  This query is executed:

    SELECT c1

    outer.c2

    j2.c2

    External J1

    Join the HELP of j2 (c1)

    ;

    There is an INTERNAL join.  Add to your sample data:

    insert into values of j1 (-1, -10);

    insert into values of j2 (-2, -20);

    to be specified.

    Moreover, USING is short for confUSING.  I suggest you use IT for all the join conditions.  Everyone (unless they you write or read a manual) does.

  • How to find the 'missing' images easily in LR 3?

    In the beginning (I'm a technoidiot), I made some mistakes and stored images in 3 places.  To try to consolidate, I moved files and now some of the images "be found" by LR.  I am currently looking looking up the number of the image one at a time.

    In the library module, look at the on the left side.

    See all "missing files"?

    If so, just find the file to LR and all images of thhe in this folder will be re-found, too.

    If you don't have missing files and you need images, then you can always follow these steps:

    Right-click on the folder (in Control Panel folder) and click on "synchronize the folder. LR then check the file and images that are not in the record of exit and re - import those that you put in this folder.

    You can also do this with your parent folder and Sub folders will be synchronized.

    And don't forget: If you want to move pictures or folders around, always do go in LR (drag / move). This way above any change syou stay LR will do.

    WW

  • Find the missing numbers in a sequence

    Hello

    We have an ORDH table, which is having an ORDERNO field which starts from 300000. currently there are approximately 100 000 documents exist in this table.
    The ORDERNO value is generated from a sequence.
    We want to find missing persons (hole in the sequence) ORDERNO from the ORDH table.
    (Ex: 300654 is missing and there are many others also missing order numbers)
    Is it possible to find all the numbers missing command in this table?

    Thanks and greetings
    Murali

    Hi, Murali,

    This will show you the missing channels in numbers between existing numbers:

    WITH     got_next_orderno     AS
    (
         SELECT     orderno
         ,     LEAD (orderno) OVER (ORDER BY orderno)     AS next_orderno
         FROM     ordh
    )
    SELECT     ordrno + 1          AS from_no
    ,     next_orderno - 1     AS to_no
    FROM     got_next_orderno
    WHERE     orderno     + 1     != next_orderno
    ;
    

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.

  • OUTER JOIN query returns the results of JOIN IN-HOUSE 11.2.0.1.0

    I'm data transfer in 11.2.01.0 (Windows XP 32-bit) and I wanted to compare the sizes of table with the same Table name in two different patterns, ML and SILENT, with a FULL OUTER JOIN (to account for all the tables and NULL values in a diagram).

    The scheme of ML has 176 tables: schema TUT a 133 tables. The use of a standard INNER JOIN gives 131 paintings.

    I get precisely the results with a FULL OUTER JOIN I get with an INTERNAL JOIN (not the same NULL values so I know they exist).

    This happens in SQL-Plus, SQL_Developer and using Oracle Wire pilot of Data_Direct.

    Here is the code:

    Login: SYS as SYSDBA or SYSTEM (same results for either)

    SELECT M.TABLE_NAME, M.NUM_ROWS, T.TABLE_NAME, T.NUM_ROWS
    OF SYS. ALL_TABLES M FULL OUTER JOIN SYS. ALL_TABLES T ON M.TABLE_NAME = T.TABLE_NAME
    WHERE
    M.OWNER = 'ML' AND
    T.OWNER = 'TUT';

    Produce the same results with LEFT OUTER joins and RIGHT OUTER joins in ASI and Oracle (+) syntax.

    Any thoughts?

    Hello

    If you read what I posted, forget it. MScallion (below) gave the correct answerr.

    If conditions such as

    owner   = 'ML'
    

    in the WHERE clause, and then they will reject the rows of the result set formed by the join condition.

    The inner join returns only 131 lines where the two 'paintings' have the same table_names.
    The outer joins return multiple lines (133, 176 or 178) before the place WHERE the provision is applied , but the WHERE clause eliminates all lines except the 131 found by the inner join.

    Published by: Frank Kulash, July 10, 2010 14:23

  • where to find the missing files .lsb

    Hello. Here's my problem, maybe you can advice me well.

    I have an old .vi in Labview 4.0, which works very well under Windows 98.

    My final goal is to make it work under Windows 7, Labview 2010.

    I know that the first, I have to open the vi in BT 8.0, except for previous version 8.0 and then open it in LV 2010.  Generally, these tasks work correctly with the other vi. I had good results with the other vi.

    But for my situation, this old vi Labview 4.0 needs some libraries (.lsb files) CIN. It gives me errors because of them.

    Here it is:

    ICTRCTRL.lsb

    DIGPRTRD.lsb

    DIGPRTCF.lsb

    AICTRL.lsb

    CHLINDVI.lsb

    AITRIG.lsb

    AICLKCFG.lsb

    AIBUFFCF.lsb

    AIHARD.lsb

    AIGRPCFG.lsb

    AIREAD.lsb

    I tried these files in Labview 4.0 and 8.0 without success. I think that copy and paste will help as I did with the other missing Subvi.

    So my question is: how to find them and 'export' in Labview 8.0?

    Is it possible to find it elsewhere on the web? Or maybe you have?

    You know that I have no experience working with external libraries.

    The only way you can have old screw DAQ with a CIN is if these screws were saved in a Bachelor's degree in law. To avoid that LabVIEW loading them, they must be removed from the llb. So, if you install the latest version of traditional DAQ, which will load and the latest LabVIEW don't use RISC. You will then have to rewrite the program to use DAQmx features since it is the only rider with the support of windows 7.

  • outer join while selecting the date max

    Hello
    Oracle 11g R2.

    I want to build a query that joins outside between 2 related tables, but selects only the date max if more than 1 record returned for a given customer. Here are the tables I and some records.

    create table customer (NumCli number, name varchar2 (100))
    create table orders (ordnum number, NumCli number, date orddate)

    insert into customers values (1, 'ABC')
    insert into customer values (2, 'DEF')
    insert into customer values (3, 'ABC')
    insert into customer values (4, 'DEF')

    insert into orders values (1, 1, sysdate)
    insert into orders values (2, 1, sysdate + 1)
    insert into orders values (3, 2, sysdate + 2)

    I created the following query, but it returns the two dates for NumCli = 1. I want to display the name of the client no matter if he has a prescription. But if there is more order, I want display the folder with the date max.

    Select a.custnum, b.SID, b.orddate
    client a, b of orders
    where a.custnum = b.custnum (+)
    and b.orddate (+) < = sysdate + 10 - additional criteria as part of the edition

    It is a simplified example of a more complex query, that I am trying to solve. If possible, could you please suggestion a request without the use of analytical functions or inline views?
    Thank you!!

    Published by: arizona9952 on April 4, 2013 22:05

    arizona9952 wrote:
    Thanks Jac. Any way to do this without a group of?

    Is there a particular reason not to use MAX?

    It will be difficult to find a maximum date without a group of... If it's ok for you to have everything available, you can use the correlated sub query...

    select a.custnum, a.name,
             (
               select b.orddate
               from   orders b
               where b.custnum = a.custnum
               and b.orddate <= sysdate + 10
               and rownum = 1 ) ordddate
    from customer a
    

Maybe you are looking for

  • iTunes says "cannot read the stream" HELP!

    Here's my workflow: <? XML version = "1.0" encoding = "UTF-8"? "" "> <!-generated by the server of the Site v6.0.0 - 8428-8428 (http://www.squarespace.com) on Monday, July 25, 2016 22:14:44 GMT-> < rss xmlns: content ="http://purl.org/rss/1.0/modules

  • Cannot find NI0DAQmx devices on the network. Test Panel button grey

    Hello I have a Dell than T710 Win Server 2008 R2 64-bit. NidaqMX 9.3 is installed. The dialog box search for network OR-DAQmx devices cannot find my NI ENET-9163 carrier with a card NI 9215. This card has a static IP address in the same subnet as the

  • HP 6200 pro (XY107ET) how to install Windows 7?

    I have a problem with a HP 6200 Pro: how to install Windows 7 from Microsoft CDs? Yes a free recovery of HP, but with an installation CD installation cleaned of all unnecessary software pre-installed. I tried with my Win 7 CD: it seems to install Win

  • Error x 116-problem of driver video stop

    Dump file: https://drive.Google.com/open?ID=0B49uvXPRmebVaHQ0Q0psZmFjSGs&AuthUser=0 New downloaded dump file driver oldest: https://drive.Google.com/file/d/0B49uvXPRmebVOXExRm84RFgyWUk/view?USP=sharing I've been running in some bsod for a few days. T

  • Problem network card under Windows 7 Enterprise 32-bit

    Hello. In our Organization a few days, the following problems occur. Windows 7 32 bit installed on a machine intel NIC 82579lm lost communication. This thing happened to 12 32-bit machines. TCP/ipv4 Protocol is inactive. Reinstall the drivers, but th