Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-2160

Implement string_agg function.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.11.3
    • Fix Version/s: 0.12.0
    • Component/s: Function/UDF
    • Labels:
      None

      Description

      I'll implement to concatenate the strings of a field within a group by query.

      I have a table:
      ID COMPANY_ID EMPLOYEE
      1 1 Anna
      2 1 Bill
      3 2 Carol
      4 2 Dave

      and I wanted to group by company_id to get something like:

      SELECT company_id, string_agg(employee, ', ')
      FROM mytable
      GROUP BY company_id;

      COMPANY_ID EMPLOYEE
      1 Anna, Bill
      2 Carol, Dave

      PostgreSQL supports string_agg function.
      http://www.postgresql.org/docs/current/static/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE

      Thank you.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                combine Byunghwa Yun
                Reporter:
                combine Byunghwa Yun
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: