plsql_判断包含字符串

时间:2015-02-27 13:45:19   收藏:0   阅读:1590

 一般有两种方法,以表plan_data_manage_productgc_routing字段为例,判断gc_routing  是否含有“B1

1. 最常想到的 like方法:

select * from plan_data_manage_product t where t.gc_routing like ‘%B1%‘;

2.“B1”是一个变量时:

select * from plan_data_manage_product t  where instr(t.gc_routing, ‘B1‘) > 0 ;

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!