Instr(str1,str2)函数的本意是查询str2在str1中的位置,不存在时返回-1
很多表单都有如下类型的字段,即字符串用,分隔,这样查询起来很不方便
这时就可以巧用instr()函数
可以在sql的末尾追加
and not exists (select 1 from t_asset_allocate_apply c where instr(c.asset_ids,a.asset_id)>0)
这样就能轻松搞定啦
Instr(str1,str2)函数的本意是查询str2在str1中的位置,不存在时返回-1
很多表单都有如下类型的字段,即字符串用,分隔,这样查询起来很不方便
这时就可以巧用instr()函数
可以在sql的末尾追加
and not exists (select 1 from t_asset_allocate_apply c where instr(c.asset_ids,a.asset_id)>0)
这样就能轻松搞定啦