phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Hyde (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-1749) ORDER BY should support column position as well as column alias
Date Sat, 28 Mar 2015 03:10:53 GMT


Julian Hyde commented on PHOENIX-1749:

Ordinal positions have to be constants. Not bind variables, or expressions. I think even +1
should not qualify.

However I think you should consider allowing "*" (say "select * from emp order by 2"). It
might be different in Phoenix, but in Oracle, what "*" expands to is deterministic, because
table columns have a well-defined order, and column #2 is always going to be deptno.

> ORDER BY should support column position as well as column alias
> ---------------------------------------------------------------
>                 Key: PHOENIX-1749
>                 URL:
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Serhiy Bilousov
>            Assignee: Alicia Ying Shu
>         Attachments: PHOENIX-1749-v1.patch, PHOENIX-1749.patch
> In postgreSQL (and many others DBs) you can specify not only column name for the ORDER
BY but column number (position in SELECT part) as well as column alias.
> see:
> 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 
> ORDER BY date_truncated 
> 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

This message was sent by Atlassian JIRA

View raw message