Oracle 常用函数

1.日期转换 :  to_date

select  * from  PAY_ORDER where TRADE_TIME < to_date('2018-01-14 13:51:06', 'yyyy-mm-dd hh24:mi:ss');

2.格式转换 :  to_char

select  * from  PAY_ORDER where to_char(TRADE_TIME,'yyyy-MM-dd HH24:mi:ss') < '2018-01-14 13:51:06';

上面两句sql查询结果一致

3.NVL函数

从两个表达式返回一个非 null 值。

语法: NVL(eExpression1, eExpression2)

4.length

获取字符串的长度

select * from pay_order where length (nvl(rate,0)) >8
『愿你我既可以朝九晚五,又能够浪迹天涯』
原文地址:https://www.cnblogs.com/zjwwljty/p/8531114.html