Github user tzolkincz commented on the pull request:

    https://github.com/apache/incubator-phoenix/pull/30#issuecomment-43854734
  
    I've finally rewrite syntax, as was mentioned. So there is summary:
    ```
    SELECT LAST_VALUE(val) WITHIN GROUP (ORDER BY date ASC) FROM table GROUP BY 
column
    ```
    ```
    SELECT NTH_VALUE(val, 2) WITHIN GROUP (ORDER BY date DESC) FROM table GROUP 
BY column
    ```
    and for sake of completeness alias of LAST_VALUE with inverted order
    ```
    SELECT FIRST_VALUE(val) WITHIN GROUP (ORDER BY date ASC) FROM table GROUP 
BY column
    ````
    
    @jtaylor-sfdc I had to change some code at ParseNodeFactory (L 366), could 
you please review it?
    And what do you think about FIRST_VALUE alias?
    
    Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to