Home > database >  For help: "date" field in the format in the database as yyyy - mm - dd, converted to yyyy
For help: "date" field in the format in the database as yyyy - mm - dd, converted to yyyy

Time:09-20

Because the sales table of field "date" format for yyyy - mm - dd format now need new fill in a column for "years" format for yyyy - mm

CodePudding user response:

To_date (' ', YYYY - MM)

CodePudding user response:

I can't show as follows:
Select
To_date (' business date ', 'YYYY - MM)
The FROM
"The public". "the sales subsidiary"
Error: "camp?" The value of the "YYYY" invalid
DETAIL: value must be an integer

Under the business date field is
The 2019-06-01
The 2019-06-01
The 2019-06-02
2019-06-05

CodePudding user response:

Select
To_date ( " open date ",
'YYYY - MM)The FROM
"The public". "the sales subsidiary";

"Business date" is the field name, use double quotation marks; Single quotes is equal to the specified string constants:

Select 'business date;

CodePudding user response:

No

Select
To_date (" business date ", "YYYY - MM)
The FROM
"The public". "the sales subsidiary 1
"> Error: function to_date (date, unknown) there is no
LINE 2: to_date (" business date ", "YYYY - MM)
^
HINT: there is no matching the specified name and parameter types of function. You may need to increase the explicit type conversion.

CodePudding user response:

Is this mean?
To_char (date, 'yyyy - mm)
  • Related