[
https://issues.apache.org/jira/browse/TRAFODION-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15748603#comment-15748603
]
ASF GitHub Bot commented on TRAFODION-2379:
-------------------------------------------
Github user traflm commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/875#discussion_r92414734
--- Diff:
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc ---
@@ -3584,6 +3586,47 @@ Start/Date Time/Shipped (EXPR)
```
<<<
+[[group_concat_function]]
+== 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 be
+inserted between group values. To eliminate the separator altogether,
specify SEPARATOR ''.
+
+[[examples_of_group_concat]]
+=== 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;
+STUDENT_NAME (EXPR)
+-------------- --------------
+scott 80 90 91 56
+tom 77 43 91
--- End diff --
Thanks Dave, it should be ordered, I will update the text.
> update sql reference manual about group_concat function
> -------------------------------------------------------
>
> Key: TRAFODION-2379
> URL: https://issues.apache.org/jira/browse/TRAFODION-2379
> Project: Apache Trafodion
> Issue Type: Documentation
> Reporter: liu ming
> Assignee: liu ming
>
> add sections about GROUP_CONCAT
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)