Questions tagged [column-alias]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
3 answers
478 views

"ERROR: column "a" does not exist" when referencing column alias

I am attempting to retrieve either a null or boolean value from a query. Here is my query: SELECT EXISTS (SELECT 1 FROM employee where add_uuid = '7e53fa47-ade3-4e94-8efd-b25f998b09c6') ...
  • 123
2 votes
1 answer
37 views

(postgre)SQL how to disambiguate a name that could be a column name or a table alias

In PostgreSQL anyway you can pass a table (row) alias into a function and it will pass the entire record in. But when you have a table alias x and also a column name x, when you specify f(x) it will ...
0 votes
1 answer
46 views

How do I add a where statement at the end of query for a column that does not have a table to reference from?

select CASE WHEN (to_char(((case when v.trip_order_start_date is null then case when v.manual_start_date is null then t.required_pickup_date else v.trip_order_start_date end else v....
2 votes
1 answer
3k views

Why does an alias with a 'having' clause not exist in PostgreSQL?

I am trying to calculate distance between two coordinates and fetching some information based on a few conditions. A similar query with the 'having' clause was working in MySQL. But why is it not ...