oracle sql like (fuzzy query), null handling

      In Oracle, fuzzy queries use like and not like. 

      In the item table, the log field is a note. When the word "sampling" is present in the note, the item is not counted. Remarks can be null.

select * from item where log not like "%抽检%";

      The expected situation is: In addition to the list of random checks, other lists are selected. The actual situation is: only those whose remarks are not null and the remarks do not contain "sampling" and even a salary are selected.

      It was later discovered that in Oracle, nvl () can be used for processing.

select * from item where nvl(log,0) not like '抽检'

      For details, please refer to:  https://blog.csdn.net/haiross/article/details/43272125

 

 

Published 48 original articles · Like 36 · Visits 130,000+

Guess you like

Origin blog.csdn.net/weixin_42845682/article/details/88814383
Recommended