2 Replies Latest reply: Nov 14, 2016 4:46 AM by Hakan Ronningberg RSS

    SQL Join - one field with three fields of second table

    Girish Talele

      Dear Experts,

      I want to Join two SAP (SQL) Tables.

      First table has a ObjectId which is a combination of three fields of second table as given below

       

      CDHDR~OBJECTID = MAPL~MANDT &  MAPL~PLNTY & MAPL~PLNNR

      700N50000000 =         700                &                N           &         50000000

       

      Sample Script as given below:-

      CDPOS:

      Load

        OBJECTID,

        MANDT,

        PLNNR,

        PLNTY,

        MATNR;

       

      SQL SELECT CDHDR~OBJECTID MAPL~MANDT MAPL~PLNTY  MAPL~PLNNR MAPL~ MATNR

      FROM CDHDR INNER JOIN MAPL ON CDHDR~OBJECTID = ???;

       

      Please suggest whether it is possible to JOIN ON three fields of second table with one field of first table.

       

      Regards,

      Girish.