[ 
https://issues.apache.org/jira/browse/TRAFODION-3286?focusedWorklogId=215211&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215211
 ]

ASF GitHub Bot logged work on TRAFODION-3286:
---------------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Mar/19 03:43
            Start Date: 19/Mar/19 03:43
    Worklog Time Spent: 10m 
      Work Description: liuyu000 commented on pull request #1814: 
[TRAFODION-3286] Add the PIVOT Function in the Trafodion SQL Reference Manual
URL: https://github.com/apache/trafodion/pull/1814#discussion_r266722029
 
 

 ##########
 File path: 
docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
 ##########
 @@ -7096,6 +7096,152 @@ PI()
 PI()
 ```
 
+<<<
+[[pivot_function]]
+== PIVOT Function
+
+The PIVOT function transposes rows of a table into a column, aggregating data 
in the process of the rotation.
+
+PIVOT is a Trafodion SQL extension.
+
+`PIVOT (_source-column_[, DELIMITER '_delimiter_'])`
+
+[[syntax_description_of_pivot]]
+=== Syntax Description of PIVOT
+
+* `_source-column_`
+
++
+is a column containing rows to be rotated.
+
+* `_delimiter_`
+
++
+is a delimiter used to separate values in a column.
+
++
+NOTE: If the `DELIMITER '_delimiter_'` is omitted, the default delimiter is a 
comma.
+
++
+*Example*
+
++
+The table _vendor_ is as follows:
+
++
+```
+SELECT * FROM vendor;
+
+VENDOR_ID VENDOR_NAME    VENDOR_EMAIL           VENDOR_EMAIL_ID
+--------- -------------- ---------------------- ---------------
+      111 Tom            [email protected]        1
+      232 Jerry          [email protected]      2
+      232 Jerry          [email protected]        3
+      367 Aven           [email protected]       4
+      367 Aven           [email protected]         5
+      367 Aven           [email protected]       6
+
+--- 6 row(s) selected.
+```
+
++
+```
+SELECT PIVOT(vendor_id), PIVOT(vendor_email) FROM vendor GROUP BY vendor_id;
 
 Review comment:
   Thanks for your suggestion, I've corrected. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 215211)
    Time Spent: 1h 40m  (was: 1.5h)

> Add the PIVOT Function in the Trafodion SQL Reference Manual
> ------------------------------------------------------------
>
>                 Key: TRAFODION-3286
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3286
>             Project: Apache Trafodion
>          Issue Type: Documentation
>            Reporter: Liu Yu
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>




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

Reply via email to