zoukankan      html  css  js  c++  java
  • sql身份证号查人数

    select a.*,b.item_name from (select sum(buy_num) num,nqh from (select substr(a.embed_dis_province,1,10) dtime,b.buy_num,case substr(a.idcardcode,1,2) when '11' then '1100' when '12' then '1200' when '31' then '3100' when '50' then '5000' else substr(a.idcardcode,1,4) end as nqh  from f_dd_distri_order a,f_dd_order_products b  where 1=1 and a.order_id=b.order_id and a.dis_order_state='100' AND a.CREATE_DATE >='2016-10-01 00:00:00' AND a.CREATE_DATE <='2016-11-23 23:59:59' ) a group by nqh) a,(select item_name,substr(a.item_code,1,4) code from xt_dictionary_item a where type_id=25 and length(format_code)<=20 and not exists(select 1 from xt_dictionary_item b where type_id=(SELECT xt.TYPE_ID FROM xt_dictionary_type xt WHERE xt.DIC_CODE='GB/T_2260_2013') and substr(b.item_code,1,3) in('110','120','310','500') and length(b.format_code)=20 and a.item_id=b.item_id )) b where a.nqh=b.code order by num desc

     

  • 相关阅读:
    lnmp+memcache+tomcat
    redis的主从搭建
    curl只取状态码
    Tomcat的优化
    pip9 安装 centos6.8
    文件的下载
    保存图片到图库更新图库
    上传图片总结
    Android 大图片预览ViewPager
    Android 软件盘 Editext 问题
  • 原文地址:https://www.cnblogs.com/niuxi/p/6094417.html
Copyright © 2011-2022 走看看