1.oracle不区分''和null,''就是null
2.fld1 <> null 进一步等于null
解决办法:nvl()函数
select a.guest_vipname,t.mobile,a.guest_viptel from vip_info t,guest_vipinfo a where nvl(a.guest_viptel,' ')!=nvl(t.mobile,' ') and a.guest_vipname=t.name
本文介绍 Oracle 数据库中 NVL 函数的应用场景及使用方法。当比较字段可能为 NULL 时,使用 NVL 函数可以有效避免因 NULL 值导致的逻辑错误。通过具体 SQL 示例展示如何在联表查询中运用 NVL 函数。
1.oracle不区分''和null,''就是null
2.fld1 <> null 进一步等于null
解决办法:nvl()函数
select a.guest_vipname,t.mobile,a.guest_viptel from vip_info t,guest_vipinfo a where nvl(a.guest_viptel,' ')!=nvl(t.mobile,' ') and a.guest_vipname=t.name
5831

被折叠的 条评论
为什么被折叠?