1 Reply Latest reply on Oct 31, 2018 11:24 AM by Deepak Rai

    When Joints are empty

    Stephanie  Gessler

      Dear all,

       

      I face the following challenge.

      I needed to change the original data as I cannot post my workbook here.

      I have table A ( main Table)

       

      Transport Mode (Key identifier)
      Auto
      Bus
      Ship1
      Train2
      Train1

       

      I need to joint it to a second table with the following two Key Identifier. Both are in one table:

       

      Trans1Trans2
      AutoVW
      BusAudi
      Ship1Train2
      TrainTrain1

       

      I need to do a left join as I need all data from the main table and need to link it to the second table for additional information. I did a left join with Trans1 but for the identifier that do not match I would like to use Trans2.

      Is there a custom SQL script I can use, I cannot have duplicates and empty fields in my main table.

      If joint Trans1 is empty then joint Trans2?

       

      Thank you for your help.