1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

On Clause Outer Join Predicate

Discussion in 'SQL-92' started by Brandlhuber Florian, Aug 1, 2017.

  1. Brandlhuber Florian

    Brandlhuber Florian New Member

    "ON clause outer join predicate" contains invalid column reference. (12480)"

    Really? Progress doesn't really mean that.
    Code (progress):
    1.  
    2. SELECT
    3.    A.Firma,
    4.    A.PP_Auftrag_Obj,
    5.    A.Auftrag,
    6.    A.AuftragsStatus,
    7.    (
    8.        CASE
    9.            WHEN A.BelegNummer != 0 THEN A.BelegNummer
    10.            ELSE A.KommissionsNr
    11.        END
    12.    ) AS BELEGNUMMER,
    13.    A.EndTermin - CURDATE() AS DIFF_ENDE,
    14.    A.Kunde,
    15.    A.PositionsNr,
    16.    A.Produktionsmenge,
    17.    A.RueckMeldeNr,
    18.    A.Prozess_Herkunft,
    19.    A.Sollmenge AS SOLL_MENGE,
    20.    A.Wunschtermin,
    21.    A.WunschStartTermin - CURDATE() AS DIFF,
    22.    A.WunschStartTermin AS START_TERMIN,
    23.    (A.Sollmenge - A.FertigMenge) AS OFFEN,
    24.    A.FertigMenge AS IST_MENGE,
    25.    CASE
    26.        WHEN A.AuftragsStatus = 'R' THEN 0
    27.        ELSE 1
    28.    END AS SORT_STATUS,
    29.  
    30.    B.Artikel,
    31.    B.ArtikelGruppe,
    32.    B.S_Artikel_Obj,
    33.    B.Sparte,
    34.    B1.Bezeichnung AS ARTIKEL_BEZ,
    35.  
    36.    C.S_Kunde_Obj,
    37.    C.Suchbegriff,
    38.    C1.Name1 AS NAME,
    39.    C2.Branche,
    40.    C2.Bezeichnung AS BRANCHE_BEZ
    41. FROM PUB.PP_Auftrag A
    42. LEFT JOIN PUB.S_Artikel B ON A.Firma = B.Firma AND A.Artikel = B.Artikel
    43. LEFT JOIN PUB.S_ArtikelSpr B1 ON B.Firma = B1.Firma AND B.Artikel = B1.Artikel AND B1.Sprache = 'D'
    44. LEFT JOIN PUB.S_Kunde C ON A.Firma = C.Firma AND A.Kunde = C.Kunde
    45. LEFT JOIN PUB.S_Adresse C1 ON C.AdressNr = C1.AdressNr
    46. LEFT JOIN PUB.S_BrancheSpr C2 ON C.Branche = C2.Branche AND C2.Sprache = 'D'
    47. WHERE
    48.    A.Firma = '100'
    49.     AND (
    50.        A.PP_Auftrag_Obj = 'PA0961:z:b8d6d68b99c27f862114307fc40813f5'
    51.        OR A.PP_Auftrag_Obj IN (
    52.            SELECT
    53.                AA.Coverage_Obj
    54.            FROM PUB.PP_Auftrag AA
    55.            WHERE
    56.                AA.Firma = '100'
    57.                AND AA.PP_Auftrag_Obj = 'PA0961:z:b8d6d68b99c27f862114307fc40813f5'
    58.        )
    59.        OR A.Coverage_Obj = 'PA0961:z:b8d6d68b99c27f862114307fc40813f5'
    60.    )
    61. WITH(NOLOCK)
     
    Last edited by a moderator: Aug 1, 2017
  2.  

Share This Page