CREATE TABLE SAS

0

I do not know what is wrong with my sentence, I do not believe the table, the line of code is as follows:

CREATE TABLE CONTRAP AS
    SELECT OPERACION_DIRECTO.TRAN_NUM,
           OPERACION_DIRECTO.INTERNAL_LENTITY,
           OPERACION_DIRECTO.EXTERNAL_BUNIT,
           OPERACION_DIRECTO.EXTERNAL_LENTITY,
           CONTRAPARTE_LEGAL.PARTY_ID AS PARTY_ID
      FROM OPERACION_DIRECTO INNER JOIN FINDURDG.LEGAL_ENTITY CONTRAPARTE_LEGAL
        ON OPERACION_DIRECTO.INTERNAL_LENTITY=CONTRAPARTE_LEGAL.PARTY_ID;

The errors that precede it:

  

Unresolved reference to table / correlation name CONTRAP

    
asked by marixxza 03.10.2018 в 20:06
source

1 answer

0

Try to do it this way, just change the names of the aliases without using the names of the tables

CREATE TABLE CONTRAP AS
        SELECT a.TRAN_NUM,
               a.INTERNAL_LENTITY,
               a.EXTERNAL_BUNIT,
               a.EXTERNAL_LENTITY,
               b.PARTY_ID
          FROM OPERACION_DIRECTO a 
          INNER JOIN LEGAL_ENTITY b ON a.INTERNAL_LENTITY=b.PARTY_ID;
    
answered by 03.10.2018 в 20:19