加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SUBSTR和INSTR经典案例

发布时间:2020-12-12 16:00:06 所属栏目:百科 来源:网络整理
导读: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(
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读