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
  • 相关阅读:
    New Skateboard
    Mike and strings
    C语言异或运算在程序设计中的妙用
    快速排序
    贪心算法
    快速排序过程分析
    深度搜索C语言伪代码
    matlab 中“newff” 函数的参数设置
    一维小波分解与去噪重构
    matlab绘图(详细)(全面)
  • 原文地址:https://www.cnblogs.com/hoge66/p/12411965.html
Copyright © 2011-2022 走看看