Can't use derived column name in SQL predicate
I'm not able to use a derived column name in a SQL predicate. For example: SELECT CUST_ID, COUNT(*) AS CNT FROM CUSTOMER_TABLE GROUP BY 1 HAVING CNT > 1 ; ERROR: Column "CNT" does not exist. If I'm using COUNT(*) in the having clause it's working fine.
0
Comments