select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and a.jbfl= nvl('',a.jbfl);
16
select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and a.jbfl= nvl(a.jbfl,'*');
16
select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and a.jbfl= nvl('',nvl(a.jbfl,'*'));
16
The results returned by these three statements are identical, although
1.nvl('',a.jbfl)
2.nvl(a.jbfl,'*')
3.nvl('',nvl(a.jbfl,'*'))
The results returned by the three functions are different. The first function does not return ''. The second and third functions may return ''. However, the left expression A. jbfl of the three functions cannot take null values, so this condition will never have the ''condition.
select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and nvl('',a.jbfl)= nvl('',a.jbfl);
16
select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and nvl(a.jbfl,'*')= nvl(a.jbfl,'*');
17
select * from ylfwzb.doubt_info a where a.dxlx = '2' and a.dxid = '90990' and a.gzid = '1000000000000001' and nvl('',nvl(a.jbfl,'*'))= nvl('',nvl(a.jbfl,'*'));
17
When the left expression may take '', the result is 17, that is, the row where a. jbfl ='' is obtained. You only need to analyze the nvl returned results.