zoukankan      html  css  js  c++  java
  • mysql关联更新like,CONCAT,Length 函数使用

    update lbmoverseascountry a inner join lbmcodeitems b on a.CountryName like CONCAT(b.name,'%')
     set CountryCode=b.`Code` where b.setid='A019' and  Length(a.CountryCode)>=6
    
    select a.CountryName,b.code
    from lbmoverseascountry a left join  lbmcodeitems b on a.CountryName=b.name
    where setid='A019' order by b.code
    
    
    select a.CountryName,b.code ,b.`NAME`
    from lbmoverseascountry a left join lbmcodeitems b on  a.CountryName like  CONCAT('%', b.name ,'%') 
    where   Length(a.CountryCode)>=6
    
    select a.CountryName,b.code ,b.`NAME`
    from lbmoverseascountry a left join lbmcodeitems b on  b.name like   CONCAT('%',a.CountryName,'%') 
    
    where   Length(a.CountryCode)>=6
  • 相关阅读:
    *args, **kwargs
    python format函数
    python自省
    生成器与迭代器
    python面试题
    xpath和gzip
    python正则表达式
    cookie
    random
    杭电1710 (已知二叉树前中序 求后序)
  • 原文地址:https://www.cnblogs.com/liuyudong0825/p/15337212.html
Copyright © 2011-2022 走看看