pg数据库中的null和空字符串不同,oracle中空字符串和null相同。
pg数据库
select*
FROM t_dc_bill_core_task_his where para is null and sid ='c0f24d51-8296-449f-bfeb-5fc439a7eba5'
查询不出来,实际上是存在的
select*
FROM t_dc_bill_core_task_his where sid ='c0f24d51-8296-449f-bfeb-5fc439a7eba5'
用执行过的函数可以查到
select*
FROM t_dc_bill_core_task_his where f_xdo_nvl(para ,'') = '' and sid ='c0f24d51-8296-449f-bfeb-5fc439a7eba5'
函数的DDL
CREATE OR REPLACE FUNCTION DC_BILL.F_XDO_NVL(expr1 NVARCHAR2, expr2 NVARCHAR2)
RETURN NVARCHAR2 AS
BEGIN
RETURN NVL(expr1, expr2);
END;