Problem with XMLTABLE and LEFT OUTER JOIN

Hi all.

I have a problem with XMLTABLE and LEFT OUTER JOIN, in 11g it returns the correct result, but in 10g it doesn't, it is illustrated as a INNER JOIN.
SELECT * FROM v$version;

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE     11.2.0.1.0     Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

--test for 11g

CREATE TABLE XML_TEST(
     ID NUMBER(2,0),
     XML XMLTYPE
);

INSERT INTO XML_TEST
VALUES
(
     1,
     XMLTYPE
     ('
          <msg>
               <data>
                    <fields>
                         <id>g1</id>
                         <dat>data1</dat>
                    </fields>
               </data>
          </msg>
     ')
);

INSERT INTO XML_TEST
VALUES
(
     2,
     XMLTYPE
     ('
          <msg>
               <data>
                    <fields>
                         <id>g2</id>
                         <dat>data2</dat>
                    </fields>
               </data>
          </msg>
     ')
);

INSERT INTO XML_TEST
VALUES
(
     3,
     XMLTYPE
     ('
          <msg>
               <data>
                    <fields>
                         <id>g3</id>
                         <dat>data3</dat>
                    </fields>
                    <fields>
                         <id>g4</id>
                         <dat>data4</dat>
                    </fields>
                    <fields>
                         <dat>data5</dat>
                    </fields>
               </data>
          </msg>
     ')
);

SELECT
     t.id,
     x.dat,
     y.seqno,
     y.id_real
FROM
     xml_test t,
     XMLTABLE
     (
          '/msg/data/fields'
          passing t.xml
          columns
               dat VARCHAR2(10) path 'dat',
               id XMLTYPE path 'id'
     )x LEFT OUTER JOIN
     XMLTABLE
     (
          'id'
          passing x.id
          columns
               seqno FOR ORDINALITY,
               id_real VARCHAR2(30) PATH '.'
     )y ON 1=1
;

ID     DAT     SEQNO     ID_REAL
--     -----     -----     -------
1     data1     1     g1
2     data2     1     g2
3     data3     1     g3
3     data4     1     g4
3     data5          
This is all nice, now the problem:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
"CORE     10.2.0.1.0     Production"
TNS for HPUX: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

--exactly the same environment as 11g (tables and rows)
SELECT
     t.id,
     x.dat,
     y.seqno,
     y.id_real
FROM
     xml_test t,
     XMLTABLE
     (
          '/msg/data/fields'
          passing t.xml
          columns
               dat VARCHAR2(10) path 'dat',
               id XMLTYPE path 'id'
     )x LEFT OUTER JOIN
     XMLTABLE
     (
          'id'
          passing x.id
          columns
               seqno FOR ORDINALITY,
               id_real VARCHAR2(30) PATH '.'
     )y ON 1=1
;

ID     DAT     SEQNO     ID_REAL
--     -----     -----     -------
1     data1     1     g1
2     data2     1     g2
3     data3     1     g3
3     data4     1     g4
As you can see in 10g that I don't have the last row, it seems that Oracle 10 g does not recognize the LEFT OUTER JOIN.

Is this a bug?, Metalink says that sometimes we can have an ORA-0600, but in this case there is no error results returned, just incorrect.

Help, please.

Kind regards.

What about try the original Oracle method for outer joins? Using (+) without the extra space

XMLTABLE(...COLUMNS ... id XMLTYPE PATH ... ) x,
XMLTABLE(... PASSING x.id ...) (+) y

Tags: Database

Similar Questions

  • Problem with the implementation of Outer JOIN

    Hello Guru,

    Here's my scenario. I know that this can be achieved in several ways. But I need this in a single in aid Of JOINS EXTERNALrequest.

    I have two tables namely masters and transactions table. I need to join two columns (trx_name, trx_type) of the two tables and the need for all transactions. Part the trickiest is off 2 join columns, one column can be NULL in the main table.

    Script TABLES:

    create master table (mstr_no number, trx_name varchar2 (100), trx_type varchar2 (100), trx_module varchar2 (100));

    insert into masters values (1, 'yyyy', 'simple', 'cont');
    insert into masters values (2, 'bbbb', < NULL >, "cust");
    insert into masters values (3, 'yyyy', 'triple', "cont1");

    create table transaction (trx_no number, trx_name varchar2 (100), trx_type varchar2 (100));

    Insert in transaction values (1, 'yyyy', 'simple');
    Insert the transaction values (2, 'bbbb', 'double');
    Insert in transaction values (3, 'yyyy', 'triple');
    Insert in transaction values (4, 'cccc', 'purple');
    commit;

    I need output like below.

    1, 'yyyy', 'simple', 'cont '.
    2, 'bbbb', < NULL >, * "cust."
    3, 'yyyy', 'triple', "cont1".
    4, 'cccc', 'purple', < NULL >

    I need to join trx_name & trx_type in the two tables. Even if one of the column is null in the main table (mstr_no = 2), I have need of the corresponding value of trx_module since trx_name made match.


    My query:
    Select a.*, b.trx_module of transaction a, master b
    where a.trx_name = b.trx_name (+)
    and a.trx_type = NVL (b.trx_type (+), 'NULL')
    order of a.trx_no

    Appreciate your help.


    Concerning
    MN

    Maybe I'm wrong, but I don't think you can do this with a single outer join:

    with
    full_matches as (
    select *
      from master
     where trx_type is not null)
    ,
    partial_matches as (
    select *
      from master
     where trx_type is null)
    select a.*
         , coalesce(b.trx_module, c.trx_module) trx_module
      from transaction a
      left outer join full_matches b
        on (a.trx_name = b.trx_name and a.trx_type = b.trx_type)
      left outer join partial_matches c
        on (a.trx_name = c.trx_name)
     ;
    
    TRX_NO TRX_NAME             TRX_TYPE             TRX_MODULE
    ------ -------------------- -------------------- ------------
         1 aaaa                 single               cont
         3 aaaa                 triple               cont1
         2 bbbb                 double               cust
         4 cccc                 purple
    

    Re-reading my answer, I see that a short explanation might be useful: the query uses two outer joins: first masters lines with the name and type are joined, and then type the lines with missing. Him coalesce work to choose the most relevant information of module.

    Published by: Martin Preiss on June 7, 2013 20:24

  • What is the difference between NOT IN and LEFT OUTER JOIN

    Hello

    I searched the difference between everywhere. But his powerlessness.
    Please tell me the differences.

    Thanks in advance
    KVB

    It's like comparing apples and oranges.

    NOT IN - exclude all lines matching the condition NOT IN (beware of NULL values).

    JOIN EXTERNAL - return of rows from the inner table even if there is no corresponding row in the outer table.

    SQL> -- NOT IN
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  where  col1 not in (1,2);
    
          COL1
    ----------
             3
    
    SQL> -- NOT IN (subquery)
    SQL>
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  where  col1 not in (select col1 from y);
    
          COL1
    ----------
             2
             3
    
    SQL> -- OUTER JOIN
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  left outer join
     10         y
     11  on x.col1 = y.col1;
    
          COL1       COL1
    ---------- ----------
             1          1
             3
             2
    
    SQL> -- Maybe it helps to contrast LOJ with just JOIN?
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  join   y
     10  on x.col1 = y.col1;
    
          COL1       COL1
    ---------- ----------
             1          1
    
    SQL> 
    
  • Problems with XMLTABLE and XMLNAMESPACES

    Hello

    I have an XMLTYPE table. When I now want to query the data I get error ORA-19228: XPST0008 - undeclared identifier: local name prefix "sfa" "sfa:Contact"

    XML data:

    <? XML version = "1.0" encoding = "ISO-8859-15? >

    < version ftc: FATCA_OECD = "Chain" xsi: schemaLocation = "urn: oecd:ties:fatca:v1 " http://xmlns.Oracle.com/xdb/documentation/FatcaXML_v1.1.xsd "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " xmlns:ftc = "urn: oecd:ties:fatca:v1" xmlns:sfa = "urn: oecd:ties:stffatcatypes:v1" > ""

    < ftc: MessageSpec >

    < sfa:TransmittingCountry > LI < / sfa:TransmittingCountry >

    < sfa:ReceivingCountry > U.S. < / sfa:ReceivingCountry >

    < sfa:MessageType > FATCA < / sfa:MessageType >

    < sfa:Contact > Alexander Zelzer < / sfa:Contact >

    < sfa:MessageRefId > 123456 < / sfa:MessageRefId >

    < sfa:CorrMessageRefId / >

    < sfa:ReportingPeriod > 2014 - 12 - 31 < / sfa:ReportingPeriod >

    < sfa:Timestamp > 2015-02-18 T 16: 38:02.000000 < / sfa:Timestamp >

    < / ftc: MessageSpec >

    < / ftc: FATCA_OECD >

    SQL query:

    SELECT msg.contact

    Of itx_ftc_fatca_oecd

    , XMLTABLE (xmlnamespaces ("urn: oecd:ties:fatca:v1' AS"ftc"," urn: oecd:ties:stffatcatypes:v1' AS "sfa"), ' / ftc: FATCA_OECD')

    PASSAGE object_value

    Messagespec COLUMNS XMLTYPE PATH ' / ftc: FATCA_OECD / ftc: MessageSpec') level 1

    , XMLTABLE ('/ ')

    PASSAGE level1.messagespec

    Msg of COLUMNS contact VARCHAR2 (38) PATH "sfa:Contact")

    ORDER BY 1;

    Has anyone an idea what is the problem?

    Thanks in advance.

    Kind regards

    Martin

    The result still contains namespace references while you are passing it in the second section XMLTABLE...

    WITH data
    AS ( SELECT XMLTYPE('
    
      
        LI
        US
        FATCA
        Alexander Zelzer
        123456
        
        2014-12-31
        2015-02-18T16:38:02.000000
      
    ' ) as CONTENT
        FROM dual
      )
    SELECT msg.contact
      FROM data tl
       , XMLTABLE(xmlnamespaces('urn:oecd:ties:fatca:v1' AS "ftc", 'urn:oecd:ties:stffatcatypes:v1' AS "sfa"),
                  '/ftc:FATCA_OECD'
                  PASSING tl.CONTENT
                  COLUMNS
                    messagespec XMLTYPE PATH '/ftc:FATCA_OECD/ftc:MessageSpec'
                  ) level1
       , XMLTABLE(xmlnamespaces('urn:oecd:ties:fatca:v1' AS "ftc", 'urn:oecd:ties:stffatcatypes:v1' AS "sfa"),
                  '/'
                  PASSING level1.messagespec
                  COLUMNS
                    contact     VARCHAR2(38) PATH 'sfa:Contact'
                 ) msg
    ORDER BY 1
    ;
    
    CONTACT
    --------------------------------------
    Alexander Zelzer
    
  • Problem with LEFT OUTER JOIN

    Hello

    I am in charge of the migration of a SQL Server 2000 database to Oracle 11 g, under what I also migrate some predefined queries, that my client has. However I can't seem to get the syntax right and it keeps failing. Could you please help me? Thank you.

    Query:
    SELECT *,(select r.recsolins from gx.repara r where r.percod=c.percod and r.concod=c.concod and r.rectpo='I' and r.recsts='F' and r.grppercod=10 and r.recnro=(select max(t.recnro) from gx.repara t where t.percod=c.percod and t.concod=c.concod and t.rectpo='I' andt.recsts='F' ) ) as NROID
    FROM gx.CONABO c, gx.abonad a  
    LEFT OUTER JOIN gx.CALLES y ON  y.dptocod=10 and y.ciucod=524 and y.CALCOD=A.AboCalEsq1, 
    LEFT OUTER JOIN gx.CALLES Z ON  z.dptocod=10 and z.ciucod=524 and z.CALCOD=A.AboCalEsq2 
    ,gx.calles x WHERE c.PERCOD in (10,60) and CONSTSHAB in ('C','D','P')
    and a.percod=c.percod and a.abocod=c.abocod and
    x.dptocod=10 and x.ciucod=524
    and x.calcod=abocal
    order by c.percod,c.concod;
    The fields are correct, but I get not found when expected in FROM clause.

    Published by: n on June 5, 2012 13:47
  • Left Outer Join with sum

    Dear elders,



    Firstly, sorry if my question is considered to be 'very novice' but I have this problem of confusion.

    Can I use the left outer join with summary?
    For example:

    Work table
    JobCode      JobGroupCode      
    111A         1100              
    112B         1100               
    113C         1100
    121A         1200
    333F         3300               
    Table No.
    JobGroupCode    ParentCode
    1100            1000
    1200            1000
    1300            1000
    3300            3000
    Activity table
    Jobcode      Mandays
    111A         5
    112B         7
    113C         3
    I want to choose with this result
    Job.JobCode    Job.JobGroupCode     JobGroup.Parentcode       Mandays
    111A           1100                 1000                      5
    112B           1100                 1000                      7               
    113C           1100                 1000                      3
    121A           1200                 1000                      0
    333F           3300                 3000                      0
    All I did was:
    select j.jobcode, j.jobgroupcode, jg.parentcode, sum(a.mandays)
      from job j
     inner join jobgroup jg on j.jobgroupcode = jg.jobgroupcode
      left join activity a on j.jobcode = a.jobcode
     group by j.jobcode, j.jobgroupcode, jg.parentcode
    and I got was only jobcode activity table, not exactly what I want to get all the work table jobcode. Could you please tell me, where I was wrong?

    result
    Job.JobCode    Job.JobGroupCode     JobGroup.Parentcode       Mandays
    111A           1100                 1000                      5
    112B           1100                 1000                      7               
    113C           1100                 1000                      3
    Thank you very much.

    Published by: user11197113 on May 25, 2009 03:31

    Published by: user11197113 on May 25, 2009 03:32

    Hello (and welcome!).

    Edit

    OK, try this:

    select j.jobcode, j.jobgroupcode, jg.parentcode, NVL(sum(a.mandays),0)
      from job j
     inner join jobgroup jg on j.jobgroupcode = jg.jobgroupcode
      left join activity a on j.jobcode = a.jobcode
     group by j.jobcode, j.jobgroupcode, jg.parentcode
    

    That will give you this:

    JOBC JOBG PARE SUM(A.MANDAYS)
    ---- ---- ---- --------------
    111A 1100 1000              5
    112B 1100 1000              7
    113C 1100 1000              3
    121A 1200 1000              0
    333F 3300 3000              0
    

    These are real results of your test data.

  • Why left outer join with a table gives me more lines?

    Hi gurus,

    I can see "view_a" and a table 'table_a '.

    view_a a county of 100 lines. Now, when I left outer join that discovers with a 'table_a', I expect all 100 lines.

    However, I'm more than 100 lines. Is it still possible?

    Also even to analyze these situations, how can I move forward?

    Because it is very high volumn of sight and takes longer to run.

    Select count (*) view_a, view_b

    where view_a.col1 = view_b.col1 (+)

    and view_a.col2 = view_b.col2 (+);

    Thank you

    I can see "view_a" and a table 'table_a '.

    view_a a county of 100 lines. Now, when I left outer join that discovers with a 'table_a', I expect all 100 lines.

    However, I'm more than 100 lines. Is it still possible?

    Also even to analyze these situations, how can I move forward?

    Because it is very high volumn of sight and takes longer to run.

    Select count (*) view_a, view_b

    where view_a.col1 = view_b.col1 (+)

    and view_a.col2 = view_b.col2 (+);

    Which is not necessarily related to the use of an outer join.

    Just join of two tables in general will give you more rows of one table has.

    Scott DEPT table contains ONE row for deptno = 10

    The EMP table has THREE rows of deptno = 10

    The number of rows you plan if you join two tables using an equi-join?

    Three - what is MORE lines the DEPT table has for deptno = 10

    Select * from Department where deptno = 10

    DEPTNO, DNAME, LOC
    10, ACCOUNTING, NEW YORK

    Select * from emp where deptno = 10

    MGR, EMPLOYMENT ENAME, EMPNO, HIREDATE, SAL, COMM, DEPTNO
    7782, CLARK, MANAGER, 7839, 6/9/1981,2450, 10
    7839, KING, PRESIDENT, 17 NOVEMBER 00, 10
    7934, MILLER, CLERK, 7782, 23 JANUARY 00: 10

    Select dept.*, emp.*
    Department, emp
    where dept.deptno = 10
    and dept.deptno = emp.deptno

    DEPTNO, DNAME, LOC, EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO_1
    10, ACCOUNTING, NEW YORK, 7782, CLARK, MANAGER, 7839, 6/9/1981,2450, 10
    10, ACCOUNTING, NEW YORK, 7839, KING, PRESIDENT, 17 NOVEMBER 00, 10
    10, ACCOUNTING, NEW YORK, 7934, MILLER, CLERK, 7782, 23 JANUARY 00: 10

    So if these are the lines ONLY in the table EMP and DEPT the query would give you THREE lines despite the DEPT table only ONE line.

    No do you expect? You get ALL the child rows that belong to the parent company. Otherwise, how could it possibly work?

    The OUTER join includes lines where the parent row exists but there is NO child line as others have shown.

    Outer joins

    Outer join extends the result of a simple join. Outer join returns all rows that satisfy the join condition and also returns some or all rows in a table for which no line of the other meet the join condition.

    Get more lines to exist in one of the paintings is a basic necessity. It usually has NOTHING to with the question of whether you have an outside to join or not.

    See the section on the JOINTS in the Oracle documentation

    http://docs.Oracle.com/CD/B28359_01/server.111/b28286/queries006.htm

  • Using Left Outer Join with reference

    I have three tables.
    Table 1: BOOK_DETAILS
    Fields: BOOK_ID, BOOK_NAME

    Table 2: BOOK_ISSUE_RECORD
    Fields: BOOK_ID, USER_NAME

    Table 3: BOOK_AUTHOR
    Fields: BOOK_ID, AUTHOR_NAME

    I must link table 1 and table 2 with a left outer join, because even if the book is not the questions to anyone, his name should come.
    I have once again display the name of the author of books for each book.
    I am able to create a query with the left outer join between table 1 and table 2. However, I am not able to give a reference to Table 3.
    Can someone help me with this please.

    Concerning
    Hawker
    select  d.book_name,
            a.book_author,
            i.user_name
      from       book_details d
            join
                 book_author a
              on (d.book_id = a.book_id)
            left join
                 book_issue_recors i
              on (d.book_id = i.book_id)
    /
    

    SY.

  • Problem format (LEFT OUTER JOIN)?

    THE addresses of Mutiple of return as a single record + current addresses

    >
    Hi all

    I have to back student addresses home and dormitory under a single registration.

    He had to go something like this:
    LAST_NAME     FIRST_NAME     ADDY_TYPE   ADDRESS             ZIP
    Smith                John             HOME         123 Awesome St     10003
    Smith               John               DORM         Oak Quad             10013
    In this format the desired:
    LAST_NAME  FIRST_NAME     ADDY_TYPE  ADDRESS         ZIP        ADDY_TYPE     ADDRESS     ZIP
    Smith            John      HOME        123 Awesome St  10003   DORM            Oak Quad     10013
    You also need to get their last addresses by date.
    The database hold records of all students have places moving from dorm to dorm
    and some permanent residence ("HOME") has changed as well.
    To return only a DORM address and only a HOME address
    for each student.

    I'm looking at possibly a function BOX to put on a line/record and RANK BY() or DENSE_RANK to determine the last addresses.

    Hope I'm making some sense and as always very grateful for any help. Thank you.
    >

    The correct code provided by Frank Kulash here:
    WITH    got_rnum     AS
    (
         SELECT     last_name
         ,     first_name
         ,     addy_type
         ,     address
         ,     zip
         ,     ROW_NUMBER () OVER ( PARTITION BY  last_name
                                   ,                    first_name
                             ,             addy_type
                             ORDER BY        addy_date     DESC     NULLS LAST
                           ) AS rnum
         FROM    table_x
    --     WHERE     ...          -- Any filtering goes here
    )
    SELECT    last_name
    ,       first_name
    ,       MIN (CASE WHEN addy_type = 'HOME' THEN address END)     AS home_address
    ,       MIN (CASE WHEN addy_type = 'HOME' THEN zip     END)     AS home_zip
    ,       MIN (CASE WHEN addy_type = 'DORM' THEN address END)     AS dorm_address
    ,       MIN (CASE WHEN addy_type = 'DORM' THEN zip     END)     AS dorm_zip
    FROM       got_rnum
    WHERE       rnum     = 1
    GROUP BY  last_name
    ,            first_name
    ;
    I need to add a 'NATION' field, located on another table for the addresses of welcome for foreign students.
    I made a LEFT OUTER JOIN with the table of the NATION and the release came out like this:
    LAST_NAME  FIRST_NAME     ADDY_TYPE  ADDRESS   ZIP      NATION    ADDY_TYPE       ADDRESS     ZIP
    Smith            John      HOME        Rue Henry M1V 4F4  CANADA      null              null             null
    Smith            John      null        null      null     null        DORM               Oak Quad     10013
    My desired output would be like this:
    LAST_NAME  FIRST_NAME     ADDY_TYPE  ADDRESS   ZIP      NATION    ADDY_TYPE       ADDRESS     ZIP
    Smith            John      HOME        Rue Henry M1V 4F4  CANADA    DORM              Oak Quad     10013
    Maybe it's something I'm not right. What is the way I'm joining tables?

    As always very grateful for your contributions. Thank you.

    Give a glance to your group by, you group on the nation, but it has two values (NULL and CANADA). Try this way:

    WITH    got_rnum     AS
    (
         SELECT     STUINFO_id
      , STUINFO_last_name
         ,     STUINFO_first_name
         ,     ADDRESSLIST_atyp_code
         ,     ADDRESSLIST_street_line1
      , ADDRESSLIST_street_line2
      , ADDRESSLIST_city
      , ADDRESSLIST_stat_code
         ,     ADDRESSLIST_zip
    
    , ADDRESSLIST_natn_code
    , NATION_nation
         ,     ROW_NUMBER () OVER ( PARTITION BY  STUINFO_last_name
                                   ,                    STUINFO_first_name
                             ,                         ADDRESSLIST_atyp_code
    
                             ORDER BY        ADDRESSLIST_from_date     DESC     NULLS LAST
                           ) AS rnum
         FROM STUINFO JOIN CLASSROSTER ON STUINFO_pidm = CLASSROSTER_pidm JOIN ADDRESSLIST ON ADDRESSLIST_pidm = STUINFO_pidm LEFT OUTER JOIN NATION ON ADDRESSLIST_NATN_CODE =NATION_CODE
    -- The WHERE part determines if the student is currently enrolled in a class
    -- ADDRESSLIST_to_date is the last date the student will be living in that residence
    WHERE ADDRESSLIST_atyp_code IN ('PR', 'CA') and  STUINFO_change_ind IS NULL and STUINFO_last_name !='Registrar'
    and CLASSROSTER_term_code='200909' and CLASSROSTER_PTRM_CODE IN ('D', 'D1', 'D2') and CLASSROSTER_CAMP_CODE='1'
    
    and (ADDRESSLIST_to_date is NULL OR ADDRESSLIST_TO_DATE > SYSDATE)
    )
    SELECT    STUINFO_id
    ,   STUINFO_last_name
    ,       STUINFO_first_name
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'PR' THEN ADDRESSLIST_STREET_LINE1  END)     AS PR_ADDRESSLIST_STREET_LINE1
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'PR' THEN ADDRESSLIST_STREET_LINE2  END)     AS PR_ADDRESSLIST_STREET_LINE2
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'PR' THEN ADDRESSLIST_city     END)     AS PR_ADDRESSLIST_city
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'PR' THEN ADDRESSLIST_stat_code     END)     AS PR_ADDRESSLIST_stat_code
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'PR' THEN ADDRESSLIST_zip     END)     AS PR_ADDRESSLIST_zip
    ,       MIN (CASE WHEN ADDRESSLIST_natn_code IS  NULL THEN ADDRESSLIST_natn_code     END)     AS PR_ADDRESSLIST_natn_code
    , MIN(NATION_nation) NATION_nation
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'CA' THEN ADDRESSLIST_STREET_LINE1  END)     AS CA_ADDRESSLIST_STREET_LINE1
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'CA' THEN ADDRESSLIST_STREET_LINE2  END)     AS CA_ADDRESSLIST_STREET_LINE2
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'CA' THEN ADDRESSLIST_city     END)     AS CA_ADDRESSLIST_city
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'CA' THEN ADDRESSLIST_stat_code     END)     AS CA_ADDRESSLIST_stat_code
    ,       MIN (CASE WHEN ADDRESSLIST_atyp_code = 'CA' THEN ADDRESSLIST_zip     END)     AS CA_ADDRESSLIST_zip
    
    FROM       got_rnum
    WHERE       rnum     = 1
    GROUP BY  STUINFO_last_name
    ,            STUINFO_first_name
    ,         STUINFO_id
    ORDER BY STUINFO_last_name;
    

    Max

  • I'm having a lot of problems with firefox and cannot figure out how to get help. It all started when I updated to 13. I get all kinds of advertising popups, I can't play a

    I'm having a lot of problems with firefox and cannot figure out how to get help. It all started when I updated to 13. I get all kinds of advertising popups, I can't play a game on FaceBook called Farm Town at all, and I get a popup of AVG on the cookies that I can't get rid of. These issues are causing me to use Chrome quite often, although I like Fox better. I've searched and searched how to get help and find nothing. How can I get personalized technical help? These problems will not occur in Chrome at all. Thank you.

    Do a check with some malware malware, analysis of programs on the Windows computer.

    You need to scan with all programs, because each program detects a different malicious program.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

  • left and right outer join

    Hi gurus,

    Left outer join:

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

    Select * from A LEFT OUTER JOIN B on A.col = B.col;

    by definition, a left outer join brings the rows that match the join condition and lines not corresponding to table A.

    My question here is "corresponding to B and no matching rows in A" is that nothing, but... SELECT * FROM A;

    can someone pls clarity...

    Thank you.

    Imagine that you had:

    TableA

    COLUMN1 COLUMN2

    'A'                1

    'B'                2

    'C'                3

    TABLEB

    COLUMN1 COLUMN2

    'A'                 'X1'

    'A'                 'X2'

    'B'                 'Y'

    'D'                 'Z'

    SELECT * FROM TABLEA;

    A 1

    B 2

    C 3

    Now, if you want to join (first column is either in table A or B, (deuxieme from tableA, third table B)

    SELECT * FROM TABLEA A JOIN TABLEB B ON (A.COLUMN1 = B.COLUMN1)

    A 1 X 1

    A 1 X 2

    B 2 Y

    SELECT * FROM TABLE LEFT B EXTERNAL ON (A.COLUMN1 = B.COLUMN1) JOIN TABLE

    A 1 X 1

    A 1 X 2

    B 2 Y

    C 3 {null}

    SELECT * FROM TABLE A TABLE RIGHT OUTER JOIN B (A.COLUMN1 = B.COLUMN1)

    A 1 X 1

    A 1 X 2

    B 2 Y

    D {null} Z

    SELECT * FROM TABLE A TABLE FULL OUTER JOIN B (A.COLUMN1 = B.COLUMN1)

    A 1 X 1

    A 1 X 2

    B 2 Y

    C 3 {null}

    D {null} Z

    HTH

  • left outer join and the where clause for the table to the right

    I want to join two tables a and b, where a is a must and b is a result set in option. When I use a left outer join to a to b, I want to achieve:

    1. Select a single column, two columns of b (not the join columns)
    2 - even if theres no friendly on the join column does not return data from one.
    3. If there is a match applies when the criteria on column b (table in option)

    so, how can I avoid no_data_found in this case? When I apply where criteria for b, so it does not return the data from one, which is a must.

    Sounds like a regular outer join to me...

    select a.col1, b.col2, b.col2
    from   tableA a
           left outer join tableB b
           on (a.id = b.id and b.colX = 'X')
    
  • LEFT OUTER JOIN, trigger after QUERY problem

    Hello

    Guide to please the following

    I wrote under query in QUERY after a BLOCK of TABULAR DATA, not as a single text element, called INVENTORY_ITEM

    Select c.cat |' '|| s.SubCat |' '|| L1.lvl1 POINT IN: DATABLOCK. INVENTORY_ITEM
    of itemcat c
    LEFT OUTER JOIN itemsubcat s on (c.catid = s.catid)
    LEFT OUTER JOIN lvl1 l1 on (s.subcatid = l1.subcatid)

    When I compile the module an error is generated

    «* ' Met the 'LEFT' symbol when waiting for one of the following values for the group with intersect less order start union where connect '.» *

    Top query works fine with ORACLE SQL DEVELOPER.

    Any solution please.

    Kind regards

    Difference

  • Modeling of the left outer join

    Hello world

    I'm tender hand to you guys for a modeling help

    I have a FACT, the customers, the Dim_Date and CUST_ADDRESS of tables to model

    Fact and the client are joined through CUST_ID

    FACT and DATE are joined through DATE_ID

    CUST_ADDRESS must be attached to the top of the model through CUST_ID, DATE_ID and this join must be Left outer because sometimes the address does not exist or is not current, which means DATE_ID could be different between Dim_Date and CUST_ADDRESS

    If it were to join internal, model would have been easy, because of the outside left that I am unable to model, it's pretty good.

    Application under
    Select D.DATE, C.CUST_NAME, CA. ADDRESS, F.AMOUNT
    Of
    F FACT
    JOIN THE
    CUSTOMER C
    ON C.CUST_ID = F.CUST_ID
    JOIN THE
    DIM_DATE D
    ON F.DATE_ID = D.DATE_ID
    LEFT OUTER JOIN
    CUST_ADDRESS CA
    ON C.CUST_ID = CA. CUST_ID AND C.DATE_ID = D.DATE_ID

    Thanks in advance

    When I add the CUSTOMER and in FACT LTS CUST_ADDRESS

    Stop it!

    Don't add CUSTOMER and CUST_ADDRESS in the FACT of LTS. Why would add you to the LTS DO?

    You design a management model: CUSTOMER is a dimension and it has its own logical table this logic table join with a logical join in the activity diagram. Ditto for CUST_ADDRESS.

    So the change, I missed earlier is CUST_ADDRESS contains no Cust_ID (ACTUALLY existing), but contains a Cust_NO, and the table to translate Cust_NO in Cust_ID is CUSTOMER?

    No problem...

    Let's start with a new alias of CUSTOMER (to keep more simple to understand at the moment), call as you want, but this new alias will be the link between the FACT and CUST_ADDRESS.

    In LTS of the dimension 'Address', you have CUST_ADDRESS initially, add an inner join on the new alias that you created in the LTS of the CUSTOMER. So now your 'Address' logical dimension contains the Cust_NO and Cust_ID and this will make the join to FACT.

    Between CUST_ADDRESS and the CLIENT, you can keep an inner join, because the target is not not for get the address of the customer, but is having the Cust_ID in the address line.

    Give it a try at that.

    But do not add these tables in the LTS, they are logical dimensions.

  • Left Outer Join help...

    Hello world

    I'm still trying to learn the SQL, and I can not specifically with the left outer join.  I normally join tables using equijoin, but I don't get the right data set returns, and designed with the help of a left or right outer join would solve the problem...

    Here is my SQL that works properly with 1 left outer join.  I build the slow query in the SQL following, you will see where I see the error.  I don't expect you to understand the data and the columns, I'm trying to join, I think the problems I encounter are related to syntax, and I hope that you can find where are my syntax errors.

    Select

    s.Name as "Pseudonym,"

    SV.view_name as "name of the view.

    s_view. Name

    Of

    s s_screen,

    s_screen_view sv

    outer join left s_view

    WE (sv.view_name = s_view.name)

    where

    SV.screen_id = ' 1-866 A - 1X3LU' and

    s.ROW_ID = sv.screen_id and

    s.repository_id = ' 866 A-1-1"and

    s_view.repository_id = ' A-1-1 866 ";

    Here is the SQL code where I encounter the following error...

    Error:

    ORA-00904: "SV". "" View_name ": invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    Error on line: column 14: 7

    Problematic SQL:

    Select

    s.Name as "Pseudonym,"

    SV.view_name as "name of the view.

    s_view. Name,

    s_applet. Name as Applet

    -b.SID like "name of the cmdlet.

    Of

    s s_screen,

    s_screen_view sv,

    wti s_view_wtmpl_it

    outer join left s_view

    WE (sv.view_name = s_view.name)

    outer join left s_applet

    WE (wti.name = s_applet.name)

    where

    SV.screen_id = ' 1-866 A - 1X3LU' and

    s.ROW_ID = sv.screen_id and

    s.repository_id = ' 866 A-1-1"and

    s_view.repository_id = ' A-1-1 866 ";

    Thanks in advance for your help.

    Chris

    > ORA-00904: "S_VIEW_WEB_TMPL." "" ROW_ID ": invalid identifier

    I don't see this table in your FROM clause.

Maybe you are looking for

  • HP Tablet: Tablet reset open question

    I forgot my password of the hp tablet of me and reset Tablet 5 seconds.After not reset no start my tablet. Please solve my problemI purchased before 4 years this Tablet

  • What security ties are necessary

    all of a sudden, I encounter computer problems with tracking cookies & stuff when I do my AVG scan everything is microsoft windows when I checked my security and it lists Administrator of Gina-PC\Admin that is me Gina-PC\useres of users Trusted Insta

  • Need advice on lenses

    I plan to buy a 80 d with 18-135mm IS USM Canon. If I want to take pictures of some sports (baseball, for example), should I the 55-250 mm of STM IS? I currently own a Canon 100-300mm F/4.5-5.6 ultrasonic lens, but it doesn't have image stabilization

  • Files problems...

    Recently I tried to create a new folder under Vista 32 bit and was unable to name it. I can type the name I want, but when I enter the name goes to the "new folder". I ran the registry cleaning software made for Vista and cleaned all the invalid regi

  • CardScan Executive 700 c Scanner USB compatible with windows 7 64 bit?

    CardScan Executive 700 c USB Scanner drivers available for Windows 7 64-bit?