trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <>
Subject [GitHub] incubator-trafodion pull request #875: [TRAFODION-2379] update sql reference...
Date Tue, 13 Dec 2016 22:13:03 GMT
Github user DaveBirdsall commented on a diff in the pull request:
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
    @@ -3584,6 +3586,47 @@ Start/Date Time/Shipped               (EXPR)
    +== GROUP_CONCAT Function
    +This function returns a string result with the concatenated non-NULL values from a group.

    +It returns NULL if there are no non-NULL values. 
    +The syntax is as follows:
    +GROUP_CONCAT([DISTINCT] expr [,expr ...]
    +             [ORDER BY {unsigned_integer | col_name | expr}
    +                 [ASC | DESC] [,col_name ...]]
    +             [SEPARATOR str_val])
    +Get the concatenated values of expression combinations. To eliminate duplicate values,

    +use the DISTINCT clause. 
    +To sort values in the result, use the ORDER BY clause. To sort in reverse order, add

    +the DESC (descending) keyword to the name of the column you are sorting by in the 
    +ORDER BY clause. The default is ascending order; this may be specified explicitly using
    +the ASC keyword. The default separator between values in a group is comma (,). To specify

    +a separator explicitly, use SEPARATOR followed by the string literal value that should
    +inserted between group values. To eliminate the separator altogether, specify SEPARATOR
    +=== Examples of GROUP_CONCAT
    +The following example returns concatenated strings for column test_score for each student.
    +>> SELECT student_name,
    +         GROUP_CONCAT(DISTINCT test_score
    +                   ORDER BY test_score DESC SEPARATOR ' ')
    +         FROM student
    +         GROUP BY student_name;
    +--------------  --------------
    +scott            80 90 91 56
    +tom              77 43 91
    --- End diff --
    The test scores aren't in order. When I tried this example, I got "91 90 80 56" for scott's
test scores, and "91 77 43" for tom's. So the code seems to work. Just this text seems to
be wrong.

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 or file a JIRA ticket
with INFRA.

View raw message