The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Computed field in Select clause

Ability to use a calculated field in a query select 1+1 as a1, a1 *10 as a2 from dual; Refer Case 00017808 / JIRA VER-27155. SQL Server and some other DBs support this. The use of a with clause and a subquery will suffice in most cases but this feature will be beneficial too. Zac.

Comments

  • Hi Zac, Thank you for the posting "Computed field in Select clause". A feature enhancement request has been submitted , but no estimate on when it might become available. Regards, Bhawana
  • Bhawana, Thank you. Would you change the status to "Under Consideration" Zac.
  • Hi Zac, Do you know that you can subqueries to obtain the same, don't you? such as select a1, a1*10 from (select 1+1 as a1 from dual); Does make sense? It should not be extra penalty cost for the subquery, but agree is not as clean as your example but it should work. Btw, all the feature request are always under consideration and are reviewed in a triage meetings, some of them get done earlier just based on priority, other features and difficulty. But we always review feature request. Hope this helps, nice to "talk" with you again. Eugenia
  • Eugenia, I agree that in most cases, a sub query or a with clause will be sufficient for simple examples as I posted. But a "Computed" field will be handy especially when the computation is very complex or needs to be done on each row of the resultset. Zac.

Leave a Comment

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

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.