extract date only from given timestamp in oracle sql

前端 未结 7 1551
后悔当初
后悔当初 2021-02-13 05:34

The following query:

select cdate from rprt where cdate <= TO_CHAR(sysdate, \'YYYY/MM/DD-HH24-MI-SS-SSSSS\') and ryg=\'R\' and cnum=\'C002\';
<
7条回答
  •  伪装坚强ぢ
    2021-02-13 06:28

    If you want the value from your timestamp column to come back as a date datatype, use something like this:

    select trunc(my_timestamp_column,'dd') as my_date_column from my_table;
    

提交回复
热议问题