DATA_FORMAT()函数
以date_format函数为例,MySQL中的date_format函数可以在虚谷数据库中使用to_char或translate函数改写,改写后在虚谷数据库中可以达到相同的效果,示例如下:
MySQL
SQL> select date_format(sysdate(), '%Y 年%m 月') from dual;
- Xugu
SQL> select translate(to_char(sysdate, 'yyyy-mm#'),'-#','年月') from dual;
MySQL
SQL> select date_format(sysdate(),'%Y-%m-%d %H') from dual;
- Xugu
SQL> select to_char(sysdate, 'yyyy-mm-dd hh24') from dual;