I have a generated Postgres query
select ..., s.name as supplier, ...
from ... supplier s ...
where ...
AND (cast(supplier as varchar(255)) ilike '%test%')
...
ORDER BY supplier desc nulls last
I get this error:
org.postgresql.util.PSQLException: ERROR: column "supplier" does not exist
if I replace the "supplier" with s.name then it's ok but I can't do that. I have this issue on other columns too but there are columns which are working fine.
There are some restriction that I can't use alias the same as the table name or what can be the problem?