How to display date in a different format in oracle

前端 未结 4 1264
萌比男神i
萌比男神i 2020-12-18 22:04

I have a table with a date field. By default, select max(date) from table; returns the date in \'dd-mmm-yy\' format. How do I select the date in \'MM/DD/YYYY\'

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 22:43

    Try the following:

    select to_char(sysdate,'mm/dd/yyyy') as maxdate from dual;
    

    Some information on the oracle-specific function to_char():

    • http://www.techonthenet.com/oracle/functions/to_char.php

提交回复
热议问题