We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Can't use derived column name in SQL predicate — Vertica Forum

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.

Comments

  • Hi Pradeep - Thank you for the question. We do not support alias in HAVING clause. Please let me know if you have any questions. Regards, Bhawana

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file