zoukankan      html  css  js  c++  java
  • SCM Exists 关联查询

    Exists  效率应该比in 高一些

    SELECT  DictItemID,DictSortCode,DictSortId,DictItemName,DictItemSName
    from scm_dict  where   EXISTS( SELECT DictSortCode FROM scm_dict_config where  DictSortCode= scm_dict.DictSortCode)
    and del_flag='0'
    order by DictSortCode 
    
    
    SELECT id
            ,DictItemID AS dictItemID
            ,DictSortCode AS dictSortCode
            ,DictSortId AS dictSortId
            ,DictItemName  AS dictItemName
            ,DictItemSName AS dictItemSName
            from scm_dict where  EXISTS( SELECT DictSortCode FROM scm_dict_config where  DictSortCode= scm_dict.DictSortCode)
            and del_flag ='0'
            order by DictSortCode
    
    SELECT dictSortCode from scm_dict where dictSortCode='sys_bargainor_type'
    
    SELECT * from scm_dict where create_by !='excel' or create_by is NULL
    and DictItemSName like '%集团%'
    
    update scm_dict d,scm_dict_config c  set d.DictSortCode=c.DictSortCode where d.DictItemSName=c.DictSortName
    and  d.DictSortCode is null and  (c.DictSortCode like '%_type%' or LENGTH(c.DictSortCode)>12)
    
    SELECT d.id,c.id,  d.DictSortCode,d.DictItemSName,c.DictSortCode from scm_dict d INNER join  scm_dict_config c on d.DictItemSName=c.DictSortName
    where d.DictSortCode is null and  (c.DictSortCode like '%_type%' or LENGTH(c.DictSortCode)>12)
    

      

    www.beicaiduo.com
  • 相关阅读:
    算法训练 素因子去重
    vs2013配置opencv2.4.9
    vs2013配置opencv2.4.9
    运用map并于执行期指定排序准则
    运用map并于执行期指定排序准则
    vs2013错误解决方法
    vs2013错误解决方法
    win8.1系统vs2013中boost 1.55.0的安装
    win8.1系统vs2013中boost 1.55.0的安装
    Vector的小知识点
  • 原文地址:https://www.cnblogs.com/hoge66/p/12411965.html
Copyright © 2011-2022 走看看