Date casting in oracle

前端 未结 1 731
孤街浪徒
孤街浪徒 2021-01-22 20:24

How does following query work , could not find documents explaining how following query works.Are there any other similar queries for casting values?

SELECT date \'2017-

相关标签:
1条回答
  • 2021-01-22 21:04

    Your query is using a date literal. From the Oracle documentation:

    You can specify a DATE value as a string literal, or you can convert a character or numeric value to a date value with the TO_DATE function. DATE literals are the only case in which Oracle Database accepts a TO_DATE expression in place of a string literal.

    To specify a DATE value as a literal, you must use the Gregorian calendar. You can specify an ANSI literal, as shown in this example:

    DATE '1998-12-25'
    
    0 讨论(0)
提交回复
热议问题