Obtain part of the data from the specified date, such as month: selectto_CHAR (sysdate, MM) FROMDUAL; or: selectextract (monthfromsysdate) fromdual; or the most stupid method, use to_char () first, convert the date to a string in the specified format and obtain the desired data through substr. Selectsubstr (
Obtain part of data FROM a specified date, such as month: select to_CHAR (sysdate, 'mm') from DUAL; or: select extract (month from sysdate) FROM dual; or the most stupid method, use to_char () to first convert the date to a string in the specified format, and get the desired data through substr. Select substr (
Obtain part of the data from the specified date:
Such as month:
Select to_CHAR (sysdate, 'mm') from dual;
Or:
Select extract (month from sysdate) from dual;
Or the most stupid method, use to_char () to first convert the date to a string in the specified format, and get the desired data through substr.
Select substr (to_char (sysdate, 'yyyy-mm-dd'), 6, 2) from dual;
Obtain other data of the date in the same way as the previous method.