SUBSTR和INSTR经典案例

前端之家收集整理的这篇文章主要介绍了SUBSTR和INSTR经典案例前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
SELECT SUBSTR('海城客运公司|中型高一',INSTR('海城客运公司|中型高一','|',1,1) + 1) SR FROM DUAL; update product_info pi set pi.brand_id=( select min(pb.brand_id) from product_brand pb where pb.status=1 and pb.brand_name=SUBSTR(pi.name,INSTR(pi.name,'-',1) - 1) ) where pi.brand_id=0 and SUBSTR(pi.name,1) - 1) in( select pb.brand_name from product_brand pb where pb.status=1 and pb.brand_id!=0 ) and SUBSTR(pi.name,1) - 1) is not null; select pi.name,1) pp,SUBSTR(pi.name,1) + 1) SR,--"adc-dd" 截取获得dd信息 SUBSTR(pi.name,1) - 1) SR1--"adc-dd" 截取获得abc信息 from product_info pi where pi.brand_id=0

猜你在找的Oracle相关文章