title: Teradata merge column/parameter table.A.A does not exist
body: <p>I am trying to merge a temp table into my main table to avoid duplicates:</p>
  
  <pre>MERGE INTO MYTABLE A USING
      (
          SELECT Y, Z, X 
          FROM MYTABLE_TEMP T
          JOIN (SELECT X FROM TABLE_X 
          WHERE COLUMN_N = '81205' GROUP BY 1) S  ON S.X = T.X
      ) B
      ON (A.Y = B.Y) AND (A.X = B.X)
  WHEN MATCHED THEN UPDATE SET A.LOAD_DS = B.LOAD_DS
  WHEN NOT MATCHED THEN INSERT VALUES (B.Y, B.Z, B.X, B.LOAD_DS );</pre>
  
  <p>I get the error: MERGE Failed. 3810: Column/Parameter 'MYTABLE.A.A' does not exist.</p>