Time and Date Operators
Table 1 describes the time and date operators.

When using time and date operators, use explicit type prefixes to modify the corresponding operands to ensure that the operands parsed by the database are consistent with user expectations and avoid unexpected results.
Example: Not specifying a data type results in an error.
1 2 3 4 5 6 7 |
gaussdb=# SELECT date '2001-10-01' - '7' AS RESULT; ERROR: GAUSS-10416: invalid input syntax for type timestamp: "7" SQLSTATE: 22007 LINE 1: SELECT date '2001-10-01' - '7' AS RESULT; ^ CONTEXT: referenced column: result |
Operator |
Example |
||
---|---|---|---|
+ |
NOTE:
In ORA-compatible mode, the query result is 2001-10-05 00:00:00. |
||
|
|||
|
|||
|
|||
|
|||
|
|||
- |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
* |
|
||
|
|||
|
|||
/ |
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot