You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (JIRA)" <ji...@apache.org> on 2019/04/01 15:21:00 UTC

[jira] [Commented] (CALCITE-683) String aggregates

    [ https://issues.apache.org/jira/browse/CALCITE-683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806896#comment-16806896 ] 

Chunwei Lei commented on CALCITE-683:
-------------------------------------

[~julianhyde], I would like to move on. But I have some questions:
 * Should I add it to SqlStdOperatorTable?(Note that it is not a standard function)
 * The syntax is different between PostgreSQL[1] and SQL Server[2] and I prefer to PostgreSQL[1]. Is it ok?

[1] [http://www.postgresqltutorial.com/postgresql-aggregate-functions/postgresql-string_agg-function/]

[2] [https://docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql?view=sql-server-2017]

> String aggregates
> -----------------
>
>                 Key: CALCITE-683
>                 URL: https://issues.apache.org/jira/browse/CALCITE-683
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>
> Per http://www.sql-workbench.net/comparison/string_aggregates.html, aggregate multiple string values to a single value, optionally delimited.
> {code}select d.department_id, 
>        d.department_name, 
>        string_agg(e.first_name, ',' order by first_name) as all_employees
> from departments d
>   join employees e on d.department_id = e.department_id
> group by d.department_id
> order by d.department_id;
> department_id | department_name  | all_employees                                                                   
> --------------+------------------+-------------------------
>            10 | Road consruction | Prostetnic Vogon Jeltz                                                                          
>            20 | Hiking           | Arthur, Ford
>            30 | Shipping         | Zaphod
>            40 | Engineering      | Marvin, Tricia{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)