Table does not have a column named when read_csv result is aliased #12129
-
The following query throws error: Table "sdrnew" does not have a column named "HASHKEY" LINE 3: WHERE sdrnew.HASHKEY != 'aaaaa123' SELECT 'aaaaa123' HASHKEY, * But the the same query without alias name is removed from the where clause works fine. SELECT 'aaaaa123' HASHKEY, * I need to use this in importing csv file and check duplicates like this. INSERT INTO sdrmain Can anybody help me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The problem is that that is not a table alias name, it's an alias for the expression inside the projection list, it does not relate to the table Your problem is somewhat similar to #11962 |
Beta Was this translation helpful? Give feedback.
-
OK. I used it as subquery with an alias and referenced the alias. |
Beta Was this translation helpful? Give feedback.
The problem is that that is not a table alias name, it's an alias for the expression inside the projection list, it does not relate to the table
Your problem is somewhat similar to #11962