[ https://issues.apache.org/jira/browse/PHOENIX-1768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377173#comment-14377173 ]
Serhiy Bilousov commented on PHOENIX-1768: ------------------------------------------ Thank you [~jamestaylor] for explanation even thou it kind of sad to hear that :(. (I truly believe that take the best from all DB would by better in a long run). As I said my thought process was since there is a lot in PHOENIX modelled after PostgreSQL and I could not use alias or expression may be ordinals would be easier to have. It's not like I really used it (ordinals) or recommend to use in production to anyone (make sql very brittle and hard to read) but sometimes it very convenient (especially when you have long expression or just for testing, debug) I will reply in [PHOENIX-1750|https://issues.apache.org/jira/browse/PHOENIX-1750] regarding workaround. SB > GROUP BY should support column position as well as column alias > --------------------------------------------------------------- > > Key: PHOENIX-1768 > URL: https://issues.apache.org/jira/browse/PHOENIX-1768 > Project: Phoenix > Issue Type: Bug > Reporter: Serhiy Bilousov > > In postgreSQL (and many others DBs) you can specify not only column name for > the GROUP BY but column number (position in SELECT part) as well as column > alias. > see: > http://www.postgresql.org/docs/9.4/static/queries-order.html > http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-GROUPBY > Adding such support would be very helpful and sometimes necessary. > I can provide real queries example if required but basically we want > something like this > given query > SELECT a, b, TRUNC(current_date(),'HOUR') AS date_truncated FROM table > we want > GROUP BY 1, 2 > Having just column number would cover both but having column alias would make > queries more readable and human friendly. Plus make it one little stem closer > to postgreSQL and SQL standard. -- This message was sent by Atlassian JIRA (v6.3.4#6332)