Former Outer Join syntax on constants

Hello

Can someone please tell me why the below two queries are performing differently. How to join a constant by using the old syntax used.

Also, how is 3 different query of query 2?

CREATE TABLE T1 (X VARCHAR2 (10), B INTEGER);

CREATE TABLE T2 (Y VARCHAR2 (10), B INTEGER);

INSERT INTO T1 VALUES('XXX',10);
INSERT INTO T1 VALUES('XXX',10);
INSERT INTO T1 VALUES('XXX',10);
INSERT INTO T1 VALUES('YYY',20);
INSERT INTO T1 VALUES('YYY',20);
INSERT INTO T1 VALUES('YYY',20);

INSERT INTO T2 VALUES('AAA',10);
INSERT INTO T2 VALUES('BBB',20);

Query 1

SELECT T1.*, T2.* FROM T1 LEFT JOIN T2

ON T1. B = T2. B

AND T1. B = 20

-OUTPUT

=========

BBB YYY 20 20

BBB YYY 20 20

BBB YYY 20 20

NULL NULL 10 XXX

NULL NULL 10 XXX

NULL NULL 10 XXX

Query 2

SELECT T1.*, T2.* FROM T1, T2

ON T1. B (+) = T2. B

AND T1. B ( + ) = 20;

OUTPUT

=======

BBB YYY 20 20

BBB YYY 20 20

BBB YYY 20 20

Request 3

SELECT T1.*, T2.* FROM T1, T2

ON T1. B (+) = T2. B

ET T2. B ( + ) = 20;

-OUTPUT

=========

BBB YYY 20 20

BBB YYY 20 20

BBB YYY 20 20

NULL NULL 10 XXX

NULL NULL 10 XXX

NULL NULL 10 XXX

Thank you and best regards,

Mathieu

Hi, nada.

967250 wrote:

Hello

My apologies for errors in queries.

Please find the three queries

QUERY1

SELECT T1.*, T2.*
T1 LEFT JOIN T2
ON T1. B = T2. B
AND T1. B = 20;

QUERY2

SELECT T1.*, T2.*
FROM T1, T2
WHERE T1. B = T2. B ( + )
AND T1. B (+) = 20;

QUERY3
SELECT T1.*, T2.*
FROM T1, T2
WHERE T1. B = T2. B ( + )
AND T2. B (+) = 20;

Query 1 and 3 produce the same results. I want to know is what is the difference between Q2 and (T1 or T3)

Thank you

Mathieu

In the query above 1, t1 is the required table (LEFT OUTER JOIN means the table on the LEFT is needed, and the other table is optional).

Query 3 is the way to do the same in the old notation.

If you use the old notation of outer join, the + sign is used by reference to the table as an option.  It should always apply for t1 or t2, not sometimes one and sometimes the other, which is what you do in the application 2.  In the State:

T1. B = T2. B ( + )

you say that t2 is optional; in the other condition

T1. B (+) = 20

you say that t1 is optional.  I don't know why that does not raise an error.  Apparently, it is just to ignore the sign in this last condition.

Tags: Database

Similar Questions

  • Bug in outer join syntax?

    I use Oracle 10.2, and I think I found a bug in what is allowed for the outer join syntax. Specifically, I am allowed to specify "outer join" without specifying if it's left, right, or full outer join. It behaves as an inner join.

    The documents show that the type_de_jointure is optional, but does not allow the 'outside' keyword be used alone: http://download.oracle.com/docs/cd/A97630_01/server.920/a96540/statements_103a.htm#2126207

    Small example:
    create table TABLE_A (ID number(10) primary key, VALUE_A varchar2(50));
    create table TABLE_B (ID number(10) primary key, VALUE_B varchar2(50));
    insert into TABLE_A (ID, VALUE_A) values (1, 'abc');
    insert into TABLE_A (ID, VALUE_A) values (2, 'def');
    insert into TABLE_A (ID, VALUE_A) values (3, 'ghi');
    insert into TABLE_B (ID, VALUE_B) values (2, 'jkl');
    insert into TABLE_B (ID, VALUE_B) values (3, 'mno');
    insert into TABLE_B (ID, VALUE_B) values (4, 'pqr');
    commit;
    select ID, VALUE_A from TABLE_A;
    select ID, VALUE_B from TABLE_B;
    select ID, VALUE_A, VALUE_B from TABLE_A join TABLE_B using (ID);
    select ID, VALUE_A, VALUE_B from TABLE_A full outer join TABLE_B using (ID);
    select ID, VALUE_A, VALUE_B from TABLE_A outer join TABLE_B using (ID);
    The release of the last three selects shows that the OUTER JOIN behaves as a simple JOIN, rather than return a syntax error or at least behave like a FULL OUTER JOIN (this is where the absence of a syntax error is misleading):
    SQL> select ID, VALUE_A, VALUE_B from TABLE_A join TABLE_B using (ID);
    
            ID VALUE_A                                            VALUE_B
    ---------- -------------------------------------------------- --------------------------------------------------
             2 def                                                jkl
             3 ghi                                                mno
    
    SQL> select ID, VALUE_A, VALUE_B from TABLE_A full outer join TABLE_B using (ID);
    
            ID VALUE_A                                            VALUE_B
    ---------- -------------------------------------------------- --------------------------------------------------
             1 abc
             2 def                                                jkl
             3 ghi                                                mno
             4                                                    pqr
    
    SQL> select ID, VALUE_A, VALUE_B from TABLE_A outer join TABLE_B using (ID);
    
            ID VALUE_A                                            VALUE_B
    ---------- -------------------------------------------------- --------------------------------------------------
             2 def                                                jkl
             3 ghi                                                mno
    
    SQL> 
    Y at - there somewhere that I can tell you that?

    If you have a supported Oracle agreement you can save a Service request with Oracle, but they can answer that this is not a bug. The problem is that the 'outside' keyword in your 3rd example is treated as an alias for TABLE_A because it is not considered as a reserved keyword.

    with table_a as (
    select 1 as id, 'abc' as value_a from dual union all
    select 2 as id, 'def' as value_a from dual union all
    select 3 as id, 'ghi' as value_a from dual
    
    )
    , table_b as (
    select 2 as id, 'jkl' as value_b from dual union all
    select 3 as id, 'mno' as value_b from dual union all
    select 4 as id, 'pqr' as value_b from dual
    )
    select ID, outer.VALUE_A, VALUE_B from TABLE_A outer join TABLE_B using (ID);
    
    ID                     VALUE_A VALUE_B
    ---------------------- ------- -------
    2                      def     jkl
    3                      ghi     mno
    

    If you query the view RESERVED_WORDS of V$ it will tell you what keywords are reserved.

    select * from V$RESERVED_WORDS where keyword in ('OUTER', 'SELECT','USING');
    
    KEYWORD                        LENGTH                 RESERVED RES_TYPE RES_ATTR RES_SEMI DUPLICATE
    ------------------------------ ---------------------- -------- -------- -------- -------- ---------
    USING                          5                      N        N        N        N        N
    OUTER                          5                      N        N        N        N        N
    SELECT                         6                      Y        N        N        N        N
    

    You'll get a similar result, if you tried

    select ID, VALUE_A, VALUE_B from TABLE_A using join TABLE_B using (ID);
    

    Kind regards
    Bob

  • LEFT OUTER JOIN SYNTAX?

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    With partitioning, OLAP, Data Mining and Real Application Testing options

    When I run:
    SELECT ACCF. SPECIMEN_ID as ACC_ID,
    ACCF. PREFIX,
    ACCF. SPECIMEN_NBR as ACC_NBR,
    RP. PHYSICIAN_ID as REFPHY_BUS_KEY,
    ACCF. SIGNOUTLOC,
    THE. Location_id as LAB_BUS_KEY,
    ACCF. COLLDATE as ACC_SPCMN_COLL_DT_ID,
    ACCF. ACDATE as ACC_CREATED_DT_ID,
    ACCF. SODATEORIG as ACC_ORIG_SIGNOUT_DT_ID,
    ACCF. SODATE as ACC_SIGNOUT_DT_ID
    OF ACC_FACT_WS ACCF.
    REFPHY_WS RP,
    THE LAB_WS
    WHERE ACCF. BLINK = RP. PHYSICIAN_ID
    AND ACCF. ACDATE > to_date('2010-06-17','YYYY-MM-DD')
    AND ACCF. PREFIX = A '
    AND ACCF. SIGNOUTLOC = (LOUISIANA). LOCATION_ID

    It works fine, but I really have an outer join on LAB_WS.
    When I run with an outer join, I get:
    SQL > SELECT ACCF. SPECIMEN_ID as ACC_ID,
    2 ACCF. PREFIX,
    3 ACCF. SPECIMEN_NBR as ACC_NBR,
    4. PR PHYSICIAN_ID as REFPHY_BUS_KEY,
    5 ACCF. SIGNOUTLOC,
    6. THE. Location_id as LAB_BUS_KEY,
    ACCF 7. COLLDATE as ACC_SPCMN_COLL_DT_ID,
    ACCF 8. ACDATE as ACC_CREATED_DT_ID,
    ACCF 9. SODATEORIG as ACC_ORIG_SIGNOUT_DT_ID,
    ACCF 10. SODATE as ACC_SIGNOUT_DT_ID
    11 ACC_FACT_WS ACCF,
    12 REFPHY_WS RP
    13 LEFT OUTER JOIN LAB_WS ON ACCF. SIGNOUTLOC = (LOUISIANA). LOCATION_ID
    14. WHERE ACCF. BLINK = RP. PHYSICIAN_ID
    15 AND ACCF. ACDATE > to_date('2010-06-17','YYYY-MM-DD')
    16 AND ACCF. PREFIX = A ';
    LEFT OUTER JOIN LAB_WS ON ACCF. SIGNOUTLOC = (LOUISIANA). LOCATION_ID
    *
    ERROR on line 13:
    ORA-00904: "ACCF. "" SIGNOUTLOC ": invalid identifier

    The previous query shows ACCF. SIGNOUTLOC is not the problem.
    What is the problem and how to fix it?
    Note: the syntax of the old outer join is not an option. The query will be finally 9 outer joins.

    Thank you
    Jon Jacobs

    Hello

    You are mixing syntax to join Oracle with ANSI, which is sometimes delicate.
    Best is to use a unique syntax, for example ANSI:

    ...
    FROM ACC_FACT_WS ACCF
         JOIN REFPHY_WS RP ON ACCF.CLIN = RP.PHYSICIAN_ID
         LEFT OUTER JOIN LAB_WS LA on ACCF.SIGNOUTLOC = LA.LOCATION_ID
    WHERE ACCF.ACDATE > to_date('2010-06-17','YYYY-MM-DD')
    AND ACCF.PREFIX = 'D'
    
  • Outer join with a constant

    Outer join when made between the columns of the two tables is easy to understand and I'm familiar with it. But when it comes to the same join with a constant, my head starts spinning... you guys can help me with this? I would appreciate that show you with examples.
    Thanks a ton.

    Hello

    >
    Ok... I want to understand the output of the last sql statement given here.
    ...
    Select * from a, b
    where col_a (+) = col_b
    and col_a (+) = 1

    It shows put it is as follows
    col_a, col_b
    1 1
    2 NULL
    NULL NULL

    Joining means: 'display all rows in table b and the corresponding rows in the table one '.
    Since it is an outer join, it also means "view b lines even if there is no corresponding row in a.

    Thus, the output contains 3 lines, which correspond to the 3 lines in b.
    Only one of them (the one with col_b = 1) had a game in a.col_a, if the column is NULL in the other lines.

    With the sample data you posted, you will get the same results without condition

    and     col_a (+) = 1
    

    If you want to understand what makes this condition, use some examples of data where this condition would fail.
    For example, add this line to the table a:

    insert into a values (2);
    

    and run your original query (including the)

    and     col_a (+) = 1
    

    ). what output you get? You get the same exact results you did without the new line in a.

    In other words, the b line where col_b = 2 has still no matches in the table has.
    True, there is now a line of table where col_a = 2, but which does not constitute a game. A match is defined by two conditions:

    where   col_a (+) = col_b
    and     col_a (+) = 1
    

    in order to have a pair of lines which meets only the first condition

    where   col_a (+) = col_b
    

    is not enough.

  • Need help with outer join

    Hello

    I have a requirement in which I need to get data from a third table where a date of the third table is higher than a date in the second array.

    Ex:

    SELECT t1.column1, t3.column2
    FROM t1, t2, t3
    WHERE t1.id = t2.foreign_id
    AND t1.id ( + ) = t3.foreign_id
    AND t3.some_date_column > t2.another_date_column
    
    

    However, using the query above returns no results if the date condition is not met. I still need to show t1.column1 and a null t3.column2.

    How should I do this?

    Thank you

    Allen

    Edit: Added information about the requirement.

    Hi Allen

    1. SELECT t1.column1, t3.column2
    2. T1, t2, t3
    3. WHERE t1.id = t2.foreign_id
    4. AND t1.id = t3.foreign_id (+)
    5. AND t3.some_date_column (+) > t2.another_date_column

    I guess that this t1.column1 must not be null. Or am I wrong? The + sign must be placed on the side where draws are accepted. You must repeat it for each condition on the table.

    Alternativlely you can use the LEFT OUT JOIN syntax. If the two columns are allowed null you need a FULL OUTER JOIN.

    BTW: The join to t2 is not required if a refefernce constraint forced.

  • Outer joins in terms?

    Hello

    I have the following code in one of my procedures, which I have never seen so far.

    Where IsActive (+) = 'Y '.

    Can someone tell me what is the purpose of the (+) singing in the condtion? Thanks in advance.

    Here's a simple example.  The first query is an outer join and work as expected.  But if we remove the outer join of the second example (on line 7), the query goes back to be an inner join.  Regardless of the other outer join syntax, this line says b.col2 * must * be equal to 1.

    SQL > with one also (select 1 col1, col2 1 Union double all the)
    2 Select 2 col1, col2 2 double)
    3, b as (1 select col1, col2 1 of double)
    4 Select
    5A, b
    6 where a.col1 = b.col1 (+)
    7 and b.col2 (+) = 1
    8;

    COL1 COL1 COL2 COL2
    -------------------- -------------------- -------------------- --------------------
    1                    1                    1                    1
    2                    2

    SQL > with one also (select 1 col1, col2 1 Union double all the)
    2 Select 2 col1, col2 2 double)
    3, b as (1 select col1, col2 1 of double)
    4 Select
    5A, b
    6 where a.col1 = b.col1 (+)
    7 and b.col2 = 1
    8;

    COL1 COL1 COL2 COL2
    -------------------- -------------------- -------------------- --------------------
    1                    1                    1                    1

  • My Confusion of outer join

    Oracle 10g

    I have three below queries that use the outer join syntax.

    All three queries return exactly the same results


    (a)
    SELECT TA.ID TA
         , TB.ID TB
      FROM TA
         , TB
     WHERE TA.ID = TB.ID(+);
    (b)
    SELECT TA.ID TA
         , TB.ID TB
      FROM TA
         , TB
     WHERE TB.ID(+) = TA.ID;
    (c)
    SELECT TA.ID TA
         , TB.ID TB
      FROM TA
      LEFT OUTER JOIN TB ON TA.ID = TB.ID;
    I have the right call outer join query because the (+) sign is located on the right and outer join query (b) left because the (+) sign is on the left?

    Or is the left join or right determined by the join columns specified in the order select it?



    Create the Script
    CREATE TABLE TA
      (
        "ID" NUMBER
      );
    
    CREATE TABLE TB
      (
        "ID" NUMBER
      );
    
    INSERT INTO TA (ID) VALUES ('1');
    INSERT INTO TA (ID) VALUES ('2');
    INSERT INTO TA (ID) VALUES ('3');
    
    INSERT INTO TB (ID) VALUES ('1');
    INSERT INTO TB (ID) VALUES ('2');
    INSERT INTO TB (ID) VALUES ('4');
    Ben

    Published by: benton on August 15, 2012 08:16

    Hi, Ben.

    Benton says:
    ... So is it correct to say that the left or right refers to which side the null values will be displayed?

    Lol it is incorrect to say that the old syntax outer join (using the sign +) is either a left - or a right outer join.

    ... So I need to have the order of the columns in the correct SELECTION so that there is no likelihood of confusion over which side will display NULL values. If I place the columns A and B in the wrong order, that is to say B then a I'll lend to confusion about what will be returned with respect whether left or right.

    No, do not hesitate to organize columns in the select in any way will help your users the most. What is happening in the FROM and WHERE clause, in particular the order in which the tables happens to appear, may not have something to do with the order of the columns in the output.
    Many readers are more comfotable with having NULL columns at the end of a line of output, or at least not at the beginning, so maybe it's one of the reasons for ta.id first in your example. Rearrange the columns in the game any way more than makes sense for people who will look at them.

  • outer join information

    Dear expert;

    If you look at the section of outer join. The user asserts that there is no complete equivalent in the outer join syntax. Is it true.

    http://www.Oracle-base.com/articles/9i/ANSIISOSQLSupport.php

    If this is not the case, no one knows the equivalent. Thank you

    It's true, but you can do something similar by using the UNION.

    Example of
    http://www.Oreillynet.com/network/2002/04/23/fulljoin.html

    Concerning
    Peter

  • Outer join with Oracle syntax

    Hi, I am new to oracle and I worked this request for reports for about 2 weeks, please take a look at my request
    SELECT mmt.transaction_date "Transaction Date", 
                msib.segment1 "Item", 
                gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4||'-'||gcc.segment5||'-'||gcc.segment6||'-'||(nvl(gcc.segment7,'000000')) "account",
                (CASE mttype.transaction_type_name
                WHEN 'Average cost update' THEN
              ((nvl(mmt.new_cost,0) - nvl(mmt.prior_cost,0)) * nvl(mmt.quantity_adjusted,0)) + nvl(mmt.variance_amount,0)
                ELSE
                 (mmt.Primary_quantity * nvl(mmt.actual_cost, 0) + nvl(mmt.variance_amount, 0))
               END) "Transaction Value",
                mttype.description "Transaction Type",
                mmt.subinventory_code "Subinventory",
                ood.organization_code "Org",
                msib.Primary_UOM_Code "UOM",
                mmt.Primary_Quantity "Primary Quantity",
                mtr.description "Reason",
                mmt.transaction_reference "Reference"
    FROM mtl_material_transactions mmt,
             mtl_system_items_b msib,
             mtl_transaction_accounts mta,
             gl_code_combinations gcc,
             mtl_transaction_types mttype,
             Org_Organization_Definitions ood,
             mtl_transaction_reasons mtr
    WHERE mmt.transaction_date >= :P_DATE_FROM 
               and mmt.transaction_date  < :P_DATE_TO +1
               and mmt.organization_id = :P_ORGANIZATION 
               and msib.organization_ID = mmt.organization_ID  
               and msib.inventory_item_id=mmt.inventory_item_id 
               and mta.transaction_id=mmt.transaction_id
               and gcc.code_combination_id = mta.reference_account
               and mttype.transaction_type_id=mmt.transaction_type_id
               and mmt.reason_id=mtr.reason_id(+)
               and ood.organization_id=mmt.organization_id
               and mttype.transaction_type_id = :P_TRANSACTION_TYPE
               and msib.segment1 = :P_ITEM
               AND gcc.segment2 = :P_ACCOUNT
    null values is on the mtl_material_transactions table, which is reason_id, subinventory_code and transaction_reference
    put desired option on would show all archives on mtl_material_transactions with null values
    so I put the symbol of the outer join right?
    BTW
    I tried to put the (+) sign on various locations but it still not good and I am really at a loss

    Hello

    Whenever you have any questions, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and the desired results from these data. I know that's not always easy, but it is really necessary. Compounds that, I do not understand your problem.
    It could be useful that simplify you the problem. If you were not interested in, say, the mta, gcc, tables msib and ood, would you still have the same problem? If so, forget all these tables and just after, CREATE TABLE and INSERT statements for the remaining tables and the results you want from this data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

    The query you posted will not exclude any line of mmt just because it doesn't have a corresponding line in the mtr; That's what the condition:

    and mmt.reason_id=mtr.reason_id(+)
    

    but it will exclude mmt lines if they do not have matching rows in other tables. Maybe you need + plus join and may under certain conditions non-join, such as conditions

    gcc.segment2 (+) = :P_ACCOUNT
    

    Too much. It's just a guess. Without seeing your sample data and the correct results, you should get from this data, I can't say.

  • outer join with syntax plus sign

    To do this in Sql outer joins can be used as grammar:
    ( + )
    What are the standards (ISO, ANSI and what version) created this grammar?
    Or is it only the invention of Oracle?

    Published by: CharlesRoos on July 1st, 2010 07:23

    Apparently, he was "there are chandeliers" ;)

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2419891400346921578 #2439016200346544570

  • Diff "full outer join" is going. "(+)" SELECT syntax?

    As far as I know there are two ways to set an outer join:

    Select... from tab1 external t1 full join tab2 t2 on t1.id = t2.id;
    or:
    SELECT... from tab1 tab2 t2, t1 where t1.id = t2.id (+)

    They are absolutely equivialent?

    Who are the most common one?

    Who serve as well on other databases (DB2, MySQL)?

    Can I put an additional WHERE clause at the end of the first statement:

    SELECT... from tab1 t1 outer join t2 on t1.id = t2.id tab2 complete WHOSE...;

    Select... from tab1 external t1 full join tab2 t2 on t1.id = t2.id;

    It's FULL OUTER JOIN

    SELECT... from tab1 tab2 t2, t1 where t1.id = t2.id (+)

    It's LEFT OUTER JOIN.

    They are quite different.

    FULL OUTER JOIN - retrieves all the rows from tab1 and tab2

    LEFT OUTER JOIN - gets all the tab1 and lines than the line that matches the join condition of tab2.

    Here is a simple test.

    create table tab1(id integer)
    /
    create table tab2(id integer)
    /
    begin
      insert into tab1 values(1);
      insert into tab1 values(2);
      insert into tab1 values(3);
    end;
    /
    begin
      insert into tab2 values(3);
      insert into tab2 values(4);
      insert into tab2 values(5);
    end;
    /
    Select t1.id, t2.id
      from tab1 t1 full outer join tab2 t2
        on t1.id =t2.id
    /
    Select t1.id, t2.id
      from tab1 t1, tab2 t2
     where t1.id = t2.id(+)
    /
    

    Run it and see the result.

  • 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

  • SSRS for lack of outer join with the Oracle data source

    It seems to be a problem with the Oracle driver used in the Reporting SERVICES query designer.

    When you use an Oracle data source, if I create an outer join in the graphic designer, it automatically inserts '{OJ' before the join and '} ' after her.  This is an incorrect syntax for Oracle and refuses to start.  The curly braces and the JO editable in designer text, but if I go back to the graphic designer and immediately to reintegrate them.

    Only, this has started to happen a year or two ago - before that it worked, but with the old (+) syntax.

    Can it not be healed?  It makes things very difficult.

    -Geoff

    Hi Geoff,

    Thanks for posting in the Microsoft Community.

    However, the question you posted would be better suited in the Forums of the Oracle Support; We recommend that you post your query in Oracle Support Forums to get help:

    https://forums.Oracle.com/forums/main.jspa;JSESSIONID=8d92100c30d8fb401bcbd10b46c38c9ddf1a3242549a.e34SbxmSbNyKai0Lc3mPbhmSc3aNe0? CategoryID = 84

    If you have any other questions or you need Windows guru, do not hesitate to post your questions and we will be happy to help you.

  • Outer join does not not as expected left

    Hi all

    I have it here are three tables with values. Mentioned the under outer join query does not and behave like the inner query.

    CREATE TABLE RET_FUND_FEE

    (

    NPTF VARCHAR2 (8 CHAR),

    TPART VARCHAR2 (4 CHAR)

    );

    CREATE TABLE PART_PTF

    (

    Mf_Id VARCHAR2 (6 CHAR) NOT NULL,

    TPARTS VARCHAR2 (4 CHAR) NOT NULL

    );

    CREATE TABLE TFC_FUNDS

    (

    NPTF VARCHAR2 (8 CHAR) NOT NULL,

    MULTIFONDS_ID VARCHAR2 (6 CHAR)

    );

    INSERT INTO RET_FUND_FEE VALUES('111','A');

    INSERT INTO RET_FUND_FEE VALUES('111','D');

    INSERT INTO RET_FUND_FEE VALUES('111','E');

    INSERT INTO PART_PTF VALUES ('MF1', 'A');

    INSERT INTO PART_PTF VALUES ('MF1', 'B');

    INSERT INTO PART_PTF VALUES('MF1','C');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    SELECT A.TPART, B.TPARTS, A.NPTF, B.Mf_Id, C.MULTIFONDS_ID, C.NPTF

    OF RET_FUND_FEE A, PART_PTF B, TFC_FUNDS C

    WHERE A.NPTF = C.NPTF

    AND C.MULTIFONDS_ID = B.Mf_Id

    AND A.TPART = B.TPARTS (+)

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    Here, I expect all records in the RET_FUND_FEE table that I am using outer join.

    But I'm only corresponding chronogram RET_FUND_FEE, PART_PTF as an inner join. Can you get it someone please let me know what lack us.

    Is my version of oracle 11g

    SELECT

    A.TPART, B.TPARTS, A.NPTF, B.Mf_Id, C.MULTIFONDS_ID, C.NPTF

    Of

    PART_PTF B

    Join

    C TFC_FUNDS

    on (C.MULTIFONDS_ID = B.Mf_Id

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    )

    right outer join

    RET_FUND_FEE HAS

    on (A.TPART = B.TPARTS

    and A.NPTF = C.NPTF) - added as correction

    TPART TPARTS NPTF MF_ID MULTIFONDS_ID NPTF
    A A 111 MF1 MF1 111
    A A 111 MF1 MF1 111
    A A 111 MF1 MF1 111
    E - 111 - - -
    D - 111 - - -

    or

    SELECT A.TPART, d.TPARTS, A.NPTF, d.Mf_Id, d.MULTIFONDS_ID, d.NPTF

    OF RET_FUND_FEE HAS

    , (

    Select

    *

    PART_PTF b, TFC_FUNDS C

    where B.Mf_Id = C.MULTIFONDS_ID

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    ) d

    WHERE A.TPART = D.TPARTS (+)

    and A.NPTF = D.NPTF (+) - added as a correction

    Sorry had to correct the syntax oracle solution.

    The first one was bad because it would return also B lines that have no match in C.

    Sorry a correction more on these two approaches, missed the second predicate.

  • A left outer join

    create table test1 (col1 varchar2 (10));

    create table test2 (col1 varchar2 (10));

    Insert into test1 values('1');

    Insert into test1 values('2');

    Insert into test1 values('3');

    Insert into test2 values('1');

    Select * from test1, test2 where test1.col1 = test2.col1 (+) and test1.col1 = 1;

    Select * from test1 test2 outer join left on test1.col1 = test2.col1 and test1.col1 = 1;

    Why are these two different results?

    Hello

    user13648517 wrote:

    create table test1 (col1 varchar2 (10));

    create table test2 (col1 varchar2 (10));

    Insert into test1 values('1');

    Insert into test1 values('2');

    Insert into test1 values('3');

    Insert into test2 values('1');

    Select * from test1, test2 where test1.col1 = test2.col1 (+) and test1.col1 = 1;

    Select * from test1 test2 outer join left on test1.col1 = test2.col1 and test1.col1 = 1;

    Why are these two different results?

    In the first query, the condition

    test1.Col1 = 1

    is not part of the join condition.  The outer join is done first and then the lines where the test1.col1 <> 1 are deleted.

    In the second query, this condition is part of the join condition.  Test1 lines are not removed results just don't not outer join conditions.

    This shows one of the many benefits of the ANSI join syntax, especially when well formatted:

    Select *.

    of test1

    outer join test2 left test1.col1 = test2.col1

    and test1.col1 = 1;

    This clearly shows that the condition "test1.col1 = 1" is part of the join condition.

Maybe you are looking for