Doubt Regarding LEFT JOIN Operation

Hello,
With the Old syntax in place it is easier for find that which join is performed on which table ...
But with the new syntax ..m getting bit confused when INNER & LEFT JOINS used together ...
Below is the FROM clause ...please explain .. how this JOIN is gonna take place ..& which table is Left joined with whom...
FROM VW_TRANS_MANAGER_SALES ref_1
LEFT OUTER JOIN VW_AGREE_ASSIGN_TAG_DTLS ass
ON Trim(ass.agreement_id) = trim(ref_1.AGREEMENT_ID)
LEFT OUTER JOIN VW_CURENT_RATING_DTLS CURR
ON (ref_1.company_code =curr.COMPANYCODE)
LEFT OUTER JOIN VW_PREV_RATING_DETAILS PREV
ON (ref_1.company_code =prev.COMPANYCODE)
LEFT OUTER JOIN CRMADMIN.CO_MA_COMPANY_CONTACTS cont
ON (ref_1.CLIENT_CONTACT_ID= cont.CONTACT_ID)
LEFT OUTER JOIN CRMADMIN.COR_CRM_MST_CITY city
ON (city.City_id= cont.City_id))
---------------------------------------------------------------------------------------------------------------------------------------

Hi,
Aijaz Mallick wrote:
Yeah .. but was a bit Confusing as u used 2 columns in each table....
Doesn't it depends on the joining condition we use ... lets Say ..if i use an INNER join after 2 LEFT join ... & m doing an that inner join with the first SOURCE table .... then will it perform a join on the resultset on the previous Joins...???Sorry, I'm not sure what you're asking.
Please post a specific example of a join that you don't understand, or some results that you don't know how to get.
Use commonly available tables (like those in the scott or hr schemas) or post your own CREATE TABLE and INSERT statements.
Using ANSI syntax, the results are as if the joins were done in the order they appear in the FROM clause (even though the optimizer may not actually do them in that order).
For example, in the querry below, the inner-join between emp and salgrade is done first, then the outer join with dept is done to that result set.
SELECT     d.dname
,     e.ename
,     g.losal
FROM          scott.emp     e
JOIN          scott.salgrade     g     ON     e.sal     BETWEEN     g.losal
                                   AND     g.hisal
RIGHT OUTER JOIN  scott.dept     d     ON     e.deptno     = d.deptno
;Output:
DNAME          ENAME           LOSAL
ACCOUNTING     CLARK            2001
ACCOUNTING     MILLER           1201
ACCOUNTING     KING             3001
RESEARCH       FORD             2001
RESEARCH       SCOTT            2001
RESEARCH       JONES            2001
RESEARCH       ADAMS             700
RESEARCH       SMITH             700
SALES          BLAKE            2001
SALES          ALLEN            1401
SALES          MARTIN           1201
SALES          WARD             1201
SALES          JAMES             700
SALES          TURNER           1401
OPERATIONSNotice that the OPERATIONS department, which has no matches in the other tables, is still included because of the outer join.
If you want to have the joins done in a different order, you can explicitly join some table first, either in a sub-query or just by grouping joins within parentheses in the same FROM clause, as in the query below (which produces the same results as the query above):
SELECT     d.dname
,     e.ename
,     g.losal
FROM          scott.dept     d
LEFT OUTER JOIN     (     -- Join the following tables first:
               scott.emp     e
          JOIN     scott.salgrade     g     ON     e.sal     BETWEEN     g.losal
                                        AND     g.hisal
          )     ON     d.deptno     = e.deptno
;

Similar Messages

  • JPA and LEFT JOIN

    I have a very basic question related to JPA.
    I am using dict tables and connecting it to MaxDB.
    In my Entity I have a select statement like this,
    @NamedQuery  (name = "getOperations", query = "SELECT operT.id FROM SII_ARC_Oper operT " +
                   "LEFT JOIN SII_ARC_Service serviceT " +
                   "ON   operT.sid = serviceT.sid AND " +
                   "serviceT.duuid =:duuid")
    When I call this in my Bean, I get this error,
    An error occurred processing the named query >>getOperations<< with the query string >>SELECT operT.id FROM SII_ARC_Oper operT LEFT JOIN SII_ARC_Service serviceT ON   operT.sid = serviceT.sid AND serviceT.duuid =:duuid<<. The exception text is: line 1: Variable 'SII_ARC_Service' not declared
    SELECT operT.id FROM SII_ARC_Oper operT LEFT JOIN SII_ARC_Service serviceT ON   operT.sid = serviceT.sid AND serviceT.duuid =:duuid
                                                      ^
    line 1: unexpected token: serviceT
    SELECT operT.id FROM SII_ARC_Oper operT LEFT JOIN SII_ARC_Service serviceT ON   operT.sid = serviceT.sid AND serviceT.duuid =:duuid
    I am just wondering how do I declare the u201CSII_ARC_Serviceu201D in my Entity before the Named Query. Or am I not declaring anything else..?
    Thanks
    Domnic
    Edited by: domnic savio on Jul 21, 2008 12:16 PM

    I have some improvements now although the problem is not solved yet,
    I have the JPQL as
    // The Named Query
    @NamedQuery  (name = "getOperations", query = "SELECT oper.id FROM SII_ARC_Oper oper " +
                   "LEFT JOIN oper.service serviceT " +
                   "WHERE serviceT.duuid =:duuid")
    // The many to one relationship
    @Column(name= "SERVICE_TABLE")
         @ManyToOne(targetEntity=com.sap.sii.archeiver.SII_ARC_Service.class)
         @JoinColumn(referencedColumnName = "SID")
         private SII_ARC_Service service;
    On calling the NamedQuery and passing a parameter, I get the error,
    Errors have occurred during the precompilation of named queries:
    An error occurred processing the named query >>getOperations<< with the query string >>SELECT operT.id FROM SII_ARC_Oper operT LEFT JOIN operT.service serviceT WHERE serviceT.duuid =:duuid<<. The exception text is: line 1: Path 'opert.service' is not association path.
    SELECT operT.id FROM SII_ARC_Oper operT LEFT JOIN operT.service serviceT WHERE serviceT.duuid =:duuid
    1) What association path does the compiler refer too !?!.
    2) Is the JPQL Querry valid without an ON clause ?!.
    anyone has an idea..!?!
    thanks in advance
    Domnic

  • Doubt regarding joins in obiee

    hi gems...
    i have a doubt regarding BI analytics join.
    When i have imported all the tables from my schema in the repository, then it got imported with all the joins defined in the database.
    then i made several business models and create some reports.
    there i got some errors, which are mainly due to self join in the tables and more than one joins between two tables.
    my question is...are these two types of joins not supported in obiee???
    and if i want more than one join condition between two tables, then what can i do???
    thanks in advance...

    Hi User,
    OBIEE doesnot support self join. To avoid such circular joins ,make use of alias tables in the physical layer.The following is a list of the main reasons to create an alias table:
    To reuse an existing table more than once in your physical layer (without having to import it several times.
    To set up multiple alias tables, each with different keys, names, or joins.
    To help you design sophisticated star or snowflake structures in the business model layer. Alias tables are critical in the process of converting ER Schemas to Dimensional Schemas
    Rgds,
    Dpka

  • Non-ANSI Outer Join Operator Issue

    I am currently using Designer 11.5.0.0.  Itu2019s XI Rel 2, but Iu2019m not sure what service pack.  I have created several universes with outer joins against a SQL Server 2005 database, but when I try using them in a Crystal report, I get the following error:
    Failed to retrieve date from the database.
    Details:  42000:[Microsoft][ODBC SQL Server Driver][SQL Server] The query uses non-ANSI outer join operators (u201C=u201D or u201C=u201D).  To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel.  It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN).  In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes.
    Here is my ODBC DSN configuration:
    Microsoft SQL Server ODBC Driver Version 03.85.1132
    Data Source Name: FlexOPS
    Data Source Description:
    Server: dalsvrw031
    Database: (Default)
    Language: (Default)
    Translate Character Data: Yes
    Log Long Running Queries: No
    Log Driver Statistics: No
    Use Integrated Security: No
    Use Regional Settings: No
    Prepared Statements Option: Drop temporary procedures on disconnect
    Use Failover Server: No
    Use ANSI Quoted Identifiers: Yes
    Use ANSI Null, Paddings and Warnings: Yes
    Data Encryption: No
    Okay, so I understand what the issue is.  It appears that the version of Designer that I am using does not default the ANSI92 parameter to u201CYesu201D.  So all the outer joins I have created in each of my universe are using the old *= as the join operator.  And apparently, the ODBC driver I am using is not very happy with that.
    As I understand it from what Iu2019ve read on other sites, I have the following options:
    1)   Set the ANSI92 parameter to Yes, drop all my joins, close and re-open Designer, and recreate all of the joins.
    2)   Find a different driver or connectivity method that will support non-ANSI joins.
    3)   Set my database back to SQL 2000 compatibility.
    Option 1 is unappealing as it will cause a lot of time redoing all the work that Iu2019ve spent the past month doing.  Option 2 is only a band-aid fix at best.  Option 3 really isnu2019t an option for us.
    So I am wondering what other options I have to change these non-ANSI joins to ANSI compatible joins.  Do I need to update Designer with a service pack?  Is there a script out there that will automatically do this in each of the universes?
    I would appreciate any suggestions or guidance on this.
    Thanks,
    Lee
    Edited by: Lee Vance on Jul 6, 2009 10:02 PM

    Hi,
    try the following:
    open your universe in the Universe designer, go to File->Parameter, select the Parameter tab and change the value of the ANSI92 parameter from No to Yes.
    Regards,
    Stratos

  • Multiple LEFT JOIN

    I'm trying to do a multiple join between three tables. Is it somehow possible to do this with this syntax where I only use the keywords LEFT JOIN and ON once?
    SELECT
         DW_STAR.PA_POSTER_FACT.*
    FROM
         DW_STAR.PA_POSTER_FACT
    LEFT JOIN
         DW_STAR.LEVERANDOER_DIM,
         DW_STAR.FAKTURAFILER
    ON
         DW_STAR.PA_POSTER_FACT.LEVERANDOER_DIM = DW_STAR.LEVERANDOER_DIM.DIMENSION_KEY AND
         DW_STAR.PA_POSTER_FACT.FAKTURA_BILAGSNUMMER = DW_STAR.FAKTURAFILER.FAKTURA_ID
    WHERE
         ROWNUM < 10

    964656 wrote:
    Okay. I just thought I've once seen the other syntax. I get the error "user requested cancel of current operation" when using this code:
    The error is returned when the user cancel the session as it says. It's not Oracle canceling by itself.
    Do you run this query in SQL Plus, TOAD or SQL Developer?
    Keep in mind that LEFT JOIN is a query which returns all records from a table even if does not have relation with the other.
    In your case, on the first query, all records in dw_star.pa_poster_fact will be returned even if they don't have found corresponding records based on join conditions in tables dw_star.leverandoer_dim and dw_star.fakturafiler.
    Is this exactly what you want? Find all records from dw_star.pa_poster_fact even if there are no records in the other tables?
    In this case however, because you select only columns from dw_star.pa_poster_fact (pos.*) your query will have the same result as:
    SELECT pos.*
    FROM
         dw_star.pa_poster_fact pos
    WHERE ROWNUM < 10;
    {code}
    I don't understand the need of joining other tables then.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Non-ANSI Outer Join Operator Issue (reposted due to text issues)

    I am currently using Designer 11.5.0.0. Itu2019s XI Rel 2, but Iu2019m not sure what service pack. I have created several universes with outer joins against a SQL Server 2005 database, but when I try using them in a Crystal report, I get the following error:
    Failed to retrieve date from the database. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server] The query uses non-ANSI outer join operators (u201C=u201D or u201C=u201D). To run this query without modification, please set the compatibility level for current database to 80 or lower, using stored procedure sp_dbcmptlevel. It is strongly recommended to rewrite the query using ANSI outer join operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). In the future versions of SQL Server, non-ANSI join operators will not be supported even in backward-compatibility modes.
    Here is my ODBC DSN configuration:
    Microsoft SQL Server ODBC Driver Version 03.85.1132
    Data Source Name: FlexOPS
    Data Source Description:
    Server: dalsvrw031
    Database: (Default)
    Language: (Default)
    Translate Character
    Data: Yes
    Log Long Running Queries: No
    Log Driver Statistics: No
    Use Integrated Security: No
    Use Regional Settings: No
    Prepared Statements Option: Drop temporary procedures on disconnect
    Use Failover Server: No
    Use ANSI Quoted Identifiers: Yes
    Use ANSI Null, Paddings and Warnings: Yes
    Data Encryption: No
    Okay, so I understand what the issue is. It appears that the version of Designer that I am using does not default the ANSI92 parameter to u201CYesu201D. So all the outer joins I have created in each of my universe are using the old *= as the join operator. And apparently, the ODBC driver I am using is not very happy with that.
    As I understand it from what Iu2019ve read on other sites, I have the following options:
    1) Set the ANSI92 parameter to Yes, drop all my joins, close and re-open Designer, and recreate all of the joins.
    2) Find a different driver or connectivity method that will support non-ANSI joins.
    3) Set my database back to SQL 2000 compatibility.
    Option 1 is unappealing as it will cause a lot of time redoing all the work that Iu2019ve spent the past month doing. Option 2 is only a band-aid fix at best. Option 3 really isnu2019t an option for us.

    So I am wondering what other options I have to change these non-ANSI joins to ANSI compatible joins. Do I need to update Designer with a service pack? Is there a script out there that will automatically do this in each of the universes? I would appreciate any suggestions or guidance on this.
    Thanks,
    Lee

  • How To do a LEFT JOIN in Oracle 8i

    Hello
    To explain my problem in a simple way: I have two tables, PROVA1 and PROVA2. Both have a primary key with two fields (CHIAVE1 amd CHIAVE2, numbers).
    I have to search for all records in A but not in B. In Oracle 8 LEFT JOIN is not available and I do not Know how doing it.
    I have read something about + operator, but I am not sure. What about:
    Select * from PROVA1 P1, PROVA2 P2 where
    (P1.CHIAVE1(+) = P2.CHIAVE1) and
    (P1.CHIAVE2(+) = P2.CHIAVE2) and
    (P2.CHIAVE1 IS NULL) and
    (P2.CHIAVE2 IS NULL)
    Thank you
    Garetano Recchi

    Gaetano, you're really close.
    The (+) sign goes near to the table where the records can be missed. In your example near P2 columns.
    Select *
      from PROVA1  P1,  PROVA2  P2
      where P1.CHIAVE1 = P2.CHIAVE1(+)
      and P1.CHIAVE2 = P2.CHIAVE2(+)
      and P2.CHIAVE1 IS NULL
      and P2.CHIAVE2 IS NULLYou can anyway use the minus operator
    Select *
      from PROVA1
      where (chiave1,chiave2) in (select chiave1, chiave2 from prova1 minus select chiave1, chiave2 from prova2);If you want to download a free book (in italiano) for oracle beginners go to
    My Oracle-related blog
    Max

  • 3 tables with left joins - bug?

    Hello,
    i am making query where i encounter problem with left join in oracle. I am using oracle 10g and i prepare simple test case.
    he is testing tables and datas - really simple i think:
    drop table t1;
    drop table t2;
    drop table t3;
    create table t1 (a number not null);
    create table t2 (a number, b number);
    create table t3 (b number);
    insert into t3 values (1);
    insert into t3 values (2);
    insert into t3 values (3);
    insert into t1 (a) values (1);
    insert into t2 (a,b) values (1,1);
    insert into t1 (a) values (2);
    insert into t2 (a,b) values (2, null);
    insert into t1 (a) values (3);
    insert into t1 (a) values (4);
    insert into t2 (a,b) values (4,1);
    insert into t1 (a) values (5);
    insert into t2 (a,b) values (5,3);
    and now query with left joins:
    select
    t1.a
    , t2.a, t2.b
    , t3.b
    from
    t1, t2, t3
    where
    t1.a = t2.a (+)
    and t2.b = t3.b (+)
    and t3.b is null
    order by t1.a
    i get two rows as result:
    A A_1 B B_1
    2 2 null null      
    3 null null null                
    i expect these rows but when i change my query - i dont want get back t3.b column:
    select
    t1.a
    , t2.a, t2.b
    /* , t3.b*/
    from
    t1, t2, t3
    where
    t1.a = t2.a (+)
    and t2.b = t3.b (+)
    and t3.b is null
    order by t1.a
    i get only one row
    A A_1 B
    2 2 null
    My question is simple how can i only by changing columns getting back change number of returned rows? I must say i dont expect these result i expect two rows again.
    Thanks for help.

    BluShadow wrote:
    I think I know what you are getting at.
    By testing for null on t3.b when you aren't selecting the column, you are enforcing oracle to perform the join through t2 onto t1, but Oracle can't join because t2 has no matching row (although it's outer joined to t1) and therefore, for the one row it can't actually determine if t3.b is null or not, so that row can't match the conditions in a "true" sense and be displayed. If you select the column then oracle can test its nullness ok. (Perhaps this is a bug, I don't know, it's just how I know it works)If you get different results only by changing the projection part of the query this is a bug and nothing else. I can't reproduce using Oracle 10g XE, I get in both cases shown the expected two rows.
    What versions are you using to test this?
    SQL>
    SQL> select * from v$version
      2  where rownum <= 1;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    SQL>
    SQL> drop table t1 purge;
    Table dropped.
    SQL> drop table t2 purge;
    Table dropped.
    SQL> drop table t3 purge;
    Table dropped.
    SQL>
    SQL> create table t1 (a number not null);
    Table created.
    SQL> create table t2 (a number, b number);
    Table created.
    SQL> create table t3 (b number);
    Table created.
    SQL>
    SQL> insert into t3 values (1);
    1 row created.
    SQL> insert into t3 values (2);
    1 row created.
    SQL> insert into t3 values (3);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (1);
    1 row created.
    SQL> insert into t2 (a,b) values (1,1);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (2);
    1 row created.
    SQL> insert into t2 (a,b) values (2, null);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (3);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (4);
    1 row created.
    SQL> insert into t2 (a,b) values (4,1);
    1 row created.
    SQL>
    SQL> insert into t1 (a) values (5);
    1 row created.
    SQL> insert into t2 (a,b) values (5,3);
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select t1.a
      2       , t2.a, t2.b
      3       , t3.b
      4  from
      5         t1 left outer join t2 on (t1.a = t2.a)
      6            left outer join t3 on (t2.b = t3.b)
      7  where t3.b is null
      8  order by t1.a;
             A          A          B          B
             2          2
             3
    SQL>
    SQL> select t1.a
      2       , t2.a, t2.b
      3  --     , t3.b
      4  from
      5         t1 left outer join t2 on (t1.a = t2.a)
      6            left outer join t3 on (t2.b = t3.b)
      7  where t3.b is null
      8  order by t1.a;
             A          A          B
             2          2
             3
    SQL>Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to achieve outer join operator(+) in HQL?

    Dear all,
    The two tables employee and customer have not explicate association (by FK and PK). In Oracle SQL, we can use the operator (+) as follows for an outer join. For example,
    SELECT * FROM  employee, customer           where employee.name = customer.name(+)
    However, HQL does not support this outer join operator. How can we translate the above SQL select to HQL?
    Regards.
    Pengyou

    shashi_rajak wrote:
    Already posted in [ hibernate forum|https://forum.hibernate.org/viewtopic.php?f=1&t=997869] . This does not have to do with java.
    Yes, but I did not get any solution.
    Hibernate has something to do with java. You can not say for example java has nothing to do with Internet or Internet has nothing to do with Computer. Anyhow, thanks for your reply.

  • Left join and where clause with not equal ( ) returns too many rows

    Say I have something like this
    Table A
    =========
    Id
    OrderNum
    Date
    StoreName
    AddressKey
    Table B
    ========
    Id
    StreetNumber
    City
    State
    select a.* from [Table A] a
    left join [Table B] b on a.AddressKey = b.Id
    where a.StoreName <> 'Burger place'
    The trouble is that the above query still returns rows that have StoreName = 'Burger place'
    One way Ive handled this is to use a table expression, select everything into that, then select from the CTE and apply the filter there.  How could you handle it in the same query however?

    Hi Joe,
    Thanks for your notes.
    INT SURROGATE PRIMARY KEY provides a small footprint JOIN ON column. Hence performance gain and simple JOIN programming.  In the Addresses table, address_id is 4 bytes as opposed to 15 bytes san. Similarly for the Orders table.
    INT SURROGATE PRIMARY KEY is a meaningless number which can be duplicated at will in other tables as FOREIGN KEY.  Having a meaningful PRIMARY KEY violates the RDBMS basics about avoiding data duplication.  If I make CelebrityName (Frank Sinatra)
    a PRIMARY KEY, I have to duplicate "Frank Sinatra" as an FK wherever it needed as opposed to duplicating SURROGATE PRIMARY KEY CelebrityID (79) a meaningless number.
    This is how we design in SQL Server world.
    QUOTE from Wiki: "
    Advantages[edit]
    Immutability[edit]
    Surrogate keys do not change while the row exists. This has the following advantages:
    Applications cannot lose their reference to a row in the database (since the identifier never changes).
    The primary or natural key data can always be modified, even with databases that do not support cascading updates across related
    foreign keys.
    Requirement changes[edit]
    Attributes that uniquely identify an entity might change, which might invalidate the suitability of natural keys. Consider the following example:
    An employee's network user name is chosen as a natural key. Upon merging with another company, new employees must be inserted. Some of the new network user names create conflicts because their user names were generated independently (when the companies
    were separate).
    In these cases, generally a new attribute must be added to the natural key (for example, an
    original_company column). With a surrogate key, only the table that defines the surrogate key must be changed. With natural keys, all tables (and possibly other, related software) that use the natural key will have to change.
    Some problem domains do not clearly identify a suitable natural key. Surrogate key avoids choosing a natural key that might be incorrect.
    Performance[edit]
    Surrogate keys tend to be a compact data type, such as a four-byte integer. This allows the database to query the single key column faster than it could multiple columns. Furthermore a non-redundant distribution of keys causes the resulting
    b-tree index to be completely balanced. Surrogate keys are also less expensive to join (fewer columns to compare) than
    compound keys.
    Compatibility[edit]
    While using several database application development systems, drivers, and
    object-relational mapping systems, such as
    Ruby on Rails or
    Hibernate, it is much easier to use an integer or GUID surrogate keys for every table instead of natural keys in order to support database-system-agnostic operations and object-to-row mapping.
    Uniformity[edit]
    When every table has a uniform surrogate key, some tasks can be easily automated by writing the code in a table-independent way.
    Validation[edit]
    It is possible to design key-values that follow a well-known pattern or structure which can be automatically verified. For instance, the keys that are intended to be used in some column of some table might be designed to "look differently from"
    those that are intended to be used in another column or table, thereby simplifying the detection of application errors in which the keys have been misplaced. However, this characteristic of the surrogate keys should never be used to drive any of the logic
    of the applications themselves, as this would violate the principles of
    Database normalization"
    LINK: http://en.wikipedia.org/wiki/Surrogate_key
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • ORA-01719: outer join operator (+) not allowed in operand of OR or IN

    I am getting the following Error when I tried to execute my Query.
    Error : ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    select unique t.estblmt_src_typ_id as estblmt_src_typ_id,
    t.name as name from estblmt_src_typ t, src_estblmt_unknown_data u, estblmt_src eSrc, estblmt e,
    additional_addr aa, country c, src_country_state_region scsr
    where
    (t.estblmt_src_typ_id=u.estblmt_src_typ_id and
    e.state_region_id=scsr.state_region_id and
    upper(scsr.code1)='UNKNOWN' and
    u.processed_ind = 'N' and
    eSrc.Estblmt_Alt_Id = u.estblmt_alt_id and
    u.estblmt_src_typ_id = eSrc.estblmt_src_typ_id and
    eSrc.Estblmt_Id = e.estblmt_id and
    e.country_id = c.country_id and
    u.estblmt_element = 'State Region' and
    scsr.estblmt_src_typ_id = u.estblmt_src_typ_id and
    aa.estblmt_id(+)=e.estblmt_id and
    e.end_dt is null) or
    (t.estblmt_src_typ_id=u.estblmt_src_typ_id and
    aa.state_region_id=scsr.state_region_id and
    upper(scsr.code1)='UNKNOWN' and u.processed_ind = 'N' and
    eSrc.Estblmt_Alt_Id = u.estblmt_alt_id and
    u.estblmt_src_typ_id = eSrc.estblmt_src_typ_id and
    eSrc.Estblmt_Id = aa.estblmt_id and aa.country_id = c.country_id and (u.estblmt_element = 'Additional State Code' or u.estblmt_element = 'Additional State Province') and scsr.estblmt_src_typ_id = u.estblmt_src_typ_id
    and aa.estblmt_id=e.estblmt_id and e.end_dt is null) order by t.name

    First, is this query being executed within Apex or at the SQL prompt or in SQL Workshop, or something else? Some context of where it's being executed may help.
    Next, that's a query from hell. How about rewrting it to use ANSI join syntax instead, so it'a bit more readable?
    A quick example for part of it would be:
    FROM (additional_addr aa LEFT OUTER JOIN estblmt e ON aa.estblmt_id = e.estblmt_id )
    etc.
    Just add additional parenthesis for each additional table join, similar to:
    FROM ((additional_addr aa LEFT OUTER JOIN estblmt e ON aa.estblmt_id = e.estblmt_id )
    LEFT OUTER JOIN src_country_state_region scsr ON aa.state_region_id = scsr.state_region_id )
    In the long run it will make the query a bit more legible, so your where clause only lists the query conditions, not the join conditions. Then it becomes easier to quickly glance at it and see where potential problems may be.
    Bill Ferguson

  • Doubt regarding Adobe forms used for PCR

    Hey all,
    I have a doubt regarding Adobe forms used for PCR.If i goto tc
    <b>SFP->form name (ISR_FORM_SPPM)->Layout->XML SOURCE-->
    <base><server name><port>/sap/bc/fp/form/layout/</base></b>
    But in tc SICF,i do not have anything beyond FP.It goes like this :<b> sicf-> default_host->sap->bc->fp</b> .
    Could this be the possible cause of error why i am not able to view the forms in PDF format?
    Can anyone , who has doen this before, please help me out with this issue?
    Thanks,
    Aditi

    Hi Aditi,
    Are you getting an error when you are trying to access the PDF form ?
    Is ADS installed and configured properly ? Also let me know the operating system you are using, it's version, J2EE and Portal version.
    Regards,
    Sunil

  • How to make a customize form with optional parameter and left join

    Hi,
    I am trying to make a report with a left join. I also want ot have optional parameters in it.
    I am using the Create Reports From SQL Query method:
    SQL is :
    select ename, sal
    from scott.emp left join scott.dept
    on scott.emp.deptno = scott.dept.deptno
    where sal >= :lower_sal
    and sal <= :higher_sal;
    However, if I do it this way, I those 2 parameters are not optional.... How can I make them optional?
    If I use the Create Reports From Query Wizard method, I can make the parameters optional, but then I cannot do the left join...
    Thanks,
    Wilson

    hi,
    to catch null values on both sides I use:
    where nvl(sal,0) >= nvl(:lower_sal,nvl(sal,0))
    and nvl(sal,0) <= nvl(:higher_sal,9999999999)
    otherwise there will be no rows in the report where the value of sal is null, even if there are no selection criteria entered.
    regards Michael

  • How to Left Join?

    I want to perform the following join to merge data from 3 tables. Can I do this using the JOIN operator or is there another way to achieve this result in OWB?
    INSERT INTO MERGETABLE (L1, L2, L3, L4)
    SELECT T2.L1, T2.L2, T3.L3, T4.L4 FROM T4
    LEFT JOIN T3 ON T3.L3=T4.L3
    LEFT JOIN T2 ON T2.L2=T3.L2

    I seem to be able to achieve the desired result by JOINing T4 and T3 on T3.L3=T4.L3 into a table TEMP and then JOINing TEMP with T2 on TEMP.L2=T2.L2. However this seems to be more complicated than necessary. Can I achieve the same result in OWB in a single step as with the original SQL command?

  • What is LEFT JOIN ?

    I have gone through LEFT JOIN . Here is LEFT JOIN . Check the link
    http://i218.photobucket.com/albums/cc298/curseofgoldendragon/test-3.png
    I have a doubt here. I see we are picking all the records from Table A ...so, I dont think we need to join here.
    We could just use a "select" query to fetch all the records from Table A...is not it ?
    Hence, I dont find usefulness of "LEFT JOIN".
    Can anybody explain if I'm missing something ?

    i like OUTER JOIN when Multi-Column Join and Join to a Constant (see table in http://www.orafaq.com/node/855)
    example
    select * from T1, T2 where T1.C1 = T2.C1(+) and T1.C2(+) = ‘Y’;but below code is more beautiful :)
    select *
    from T1 left outer join T2 on (T1.C1 = T2.C1 and T1.C2 = ‘Y’)also U may use something
    select *
    from T1 left outer join T2 on (T1.C1 = T2.C1 and substr(T1.C2,10,20) = ‘Y’)but in plus notation it's more complex
    Edited by: AlexAnd on Jun 24, 2011 1:08 AM

Maybe you are looking for

  • How to clean old Earlywatch reports in Solution Manager

    Hi, We are using SOLMAN 7.0 for EarlyWatch alerts, everything is fine and EarlyWatch is generating Reports weekly. Now i had a concern on how to clean these Early Watch reports once they are like month old, Does SAP Standard Jobs take care of this or

  • Update to iTunes hung, now iTunes is gone and I can't reinstall

    I finally had time to update to the latest version of iTunes, but the install hung at about 90% and I finally killed the process. Now iTunes won't run at all, and reinstalling fails with a fairly cryptic message about reinstalling manually. Guess I s

  • Material Movements with erdat

    Hi , I am using 'BAPI_GOODSMVT_GETITEMS' to take all material movements. call function 'BAPI_GOODSMVT_GETITEMS'     tables       material_ra     = material       plant_ra        = plant       pstng_date_ra   = budat       goodsmvt_header = header    

  • Apex french version of collection returns less records

    Hi, I have a collection when debuging it, I can see 5 rows on my collection which is correct but the actual report only shows two records (excludes ones with empty columns). This is the result of my report which is based on this query select c001,c00

  • How to fix an Ipod?

    how can i fix an ipod when it does not work