简体   繁体   中英

Amazon Redshift not allowing UPDATE + JOIN on existing tables and not find appropriate columns?

Using Amazon redshift to update some columns with POSTGRESQL.

I have two tables:

Table A                                   

   A        B        C         D
0  23as     asd      adf      [NULL]
1  23as     asd      adf      [NUll]
2  23as     asd      adf      [NUll]

Table B                                   

   A        B        C         D
0  23as     asd      adf      4234
1  23as     asd      adf      5454
2  23as     asd      adf      7867

I am trying to populate tableA.D with tableB.D in a join but the error I am getting is that

"SQL Error [500310] [42703]: [Amazon](500310) Invalid operation: column "d" of relation "tableA" does not exist;
  [Amazon](500310) Invalid operation: column "d" of relation "tableA" does not exist;
    com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: column "d" of relation "tableA" does not exist;

Here is my update/join statement:

update tableA
set d= tableB.d
from tableB
where 
    tableA.A= tableB.A and
    tableB.C= 'Completed '

What am I doing wrong that this simple UPDATE + JOIN is not working, and it is not finding the column in the table?

我是个白痴,我错误地拼写了表格名称。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM