I would like to:
- Join two tables
- Remove "queryGroupName" = 'DELETE' from the first table
- From the first table, get Id by deduping (distinct ID)
- Using this Id, inner join with another table
- For output, select only the second table
SELECT "TABLE2".*
FROM (SELECT DISTINCT "Id" FROM DB1."PUBLIC"."TABLE1")
INNER JOIN DB1."PUBLIC"."TABLE2" ON DB1."PUBLIC"."TABLE1"."Id" = DB1."PUBLIC"."TABLE2"."Id"
WHERE "queryGroupName" not in ('DELETE');
I'm getting following error message:
SQL compilation error: error line 4 at position 3 invalid identifier 'DB1.PUBLIC.TABLE1."Id"'
Does anyone know why?