Specify the date to query the number of Oracle databases and specify the date to query the oracle database
1. First, introduce the to_char function.
TO_CHAR converts a date or number to a string and cannot specify the string length.
Use the TO_CHAR function to process the date:
TO_CHAR (number, 'format') for example: TO_CHAR (salary, '$99,999.99 ')
Use the TO_CHAR function to process the date:
TO_CHAR (date, 'format'); TO_CHAR (newdate, 'yyyy-mm-dd') -- convert the specified date to year-month-day
TO_CHAR (newdate, 'yyyy-mm-dd hh24: mi: ssss') -- converts a specified date to year, month, day, hour, minute, and second.
2. You can use iPad or substring to operate the operating string in oracle.
The length of the specified string can be lpad, rpad, or substring:
Lpad (field name, fill length, fill character) left fill
Rpad (field name, fill length, fill character) Right fill
Substr (string, start_position, [length]) gets the string with the specified start position and length.
Next, we will query the data information of March December 5.
Select * from table_name t where to_char (t. column_name, 'yyyy-mm-dd') = '2017-12-05'
Query the first December 5 data records in 100.
Select * from (select * from table_name t where to_char (t. column_name, 'yyyy-mm-dd') = '2017-12-05 ') where rownum <= 2014