trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liuyu000 <...@git.apache.org>
Subject [GitHub] trafodion pull request #1656: [TRAFODION-3159] Add *Syntax Descriptions and ...
Date Wed, 25 Jul 2018 02:00:34 GMT
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1656#discussion_r204962639
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_functions_and_expressions.adoc
---
    @@ -9066,13 +9066,220 @@ second argument describes the format of the character value.
     TO_CHAR(character-expression [,format-string])
     ```
     
    +[[to_char_syntax]]
    +=== Syntax Description of TO_CHAR
    +
     * `_character-expression_`
     +
     is an expression that gives a datetime value.
     
     * `_format-string_`
     +
    -is one of the following character string literals:
    +.Details of `_format-string_`
    +[cols="3*.^"]
    +|===
    +^| *Supported* `_character-expression_` 
    +^| *`_format-string_`* 
    +^| *Description* 
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'CC'
    +| Two-digital century.
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'D'
    +| Day of week (1-7), where 1 is Sunday, 6 is Saturday. +
    +This is not configurable.
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'DD'
    +| Day of month (01-31).
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'DDD'
    +| Day of year (001-366).
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'DY'
    +a| Name of day, which is a three-letter abbreviation for the day in uppercase. +
    +
    +Following values are valid: +
    +
    +* MON +
    +
    +* TUE +
    +
    +* WED +
    +
    +* THU +
    +
    +* FRI +
    +
    +* SAT +
    +
    +* SUN
    +
    +a| * `_datetime-expression_` 
    +** DATE 
    +** TIMESTAMP 
    +| 'DAY'
    +a| Name of day, which is full uppercase day name padded with blanks to the length of
9 characters. +
    +
    +Following values are valid: +
    +
    +* MONDAY +
    +
    +* TUESDAY +
    +
    +* WEDSDAY +
    +
    +* THURSDAY +
    +
    +* FRIDAY +
    +
    +* SATURDAY +
    +
    +* SUNDAY
    +
    +a| * `_datetime-expression_` 
    +** TIME
    +** TIMESTAMP 
    +| 'HH'
    +| Hour of day in 24-hour format (00-23). +
    +'HH' behaves the same as 'HH24'.
    +
    +a| * `_datetime-expression_` 
    +** TIME
    +** TIMESTAMP 
    +| 'HH12'
    +| Hour of day in 12-hour format (01-12).
    +
    +a| * `_datetime-expression_` 
    +** TIME
    +** TIMESTAMP 
    +| 'HH24'
    +| Hour of day in 24-hour format (00-23). +
    +'HH24' behaves the same as 'HH'.
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'J'
    +| Number of days since Julian date (January 1, 4713 BC).
    +
    +a| * `_datetime-expression_` 
    +** TIME
    +** TIMESTAMP 
    +| 'MI'
    +| Minute (00-59).
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'MM'
    +| Month (01-12).
    +
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'MON'
    +a| Month, which is a three-letter abbreviation for the month in uppercase. +
    +
    +Following values are valid: +
    +
    +* JAN +
    +
    +* FEB +
    +
    +* MAR +
    +
    +* APR +
    +
    +* MAY +
    +
    +* JUN +
    +
    +* JUL +
    +
    +* AUG +
    +
    +* SEP +
    +
    +* OCT +
    +
    +* NOV +
    +
    +* DEC
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'Q'
    +| Quarter (1-4).
    +
    +a| * `_datetime-expression_` 
    +** TIME
    +** TIMESTAMP 
    +| 'SS'
    +| Second (00-59).
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'W'
    +| Week of month.
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'WW'
    +a| Week of year. +
    +
    +* The value 1 is returned for datetime that occurs in the first 7 days of the year if
the year begins on Sunday. +
    +Otherwise, the value 1 is returned for datetime that occurs in the partial week before
the start of the first Sunday. 
    +
    +* The value *53* is returned for datetime that occurs in the last full or partial week
of the year. 
    +
    +* The value *54* is returned for datetime that occurs in the last full or partial week
of the leap year where begins on Saturday.
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'Y'
    +| Last digit of year (0-9).
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'YY'
    +| Last two digits of year (00-99).
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'YYY'
    +| Last three digits of year (000-999).
    +
    +a| * `_datetime-expression_` 
    +** DATE
    +** TIMESTAMP 
    +| 'YYYY'
    +| Four-digit year (0001-9999).
    +|===
    +
    ++
    +Besides the `_format-string_` listed above, following character string literals are also
valid:
    --- End diff --
    
    Thanks Dave, I've corrected 😁


---

Mime
View raw message