zoukankan      html  css  js  c++  java
  • bianwu中的常用sql 查询

    一、年度选题立项统计

    --年度选题立项统计,
    --内容:
    --选题号themeid 、版印次nthedition,nthpress、立项时间declaredate、
    --类型(出版、重印、再版)、选题类别1、选题类别2、编室(部门)
    --themetype 00 初版, 01 再版,02 重版 ,03  合作项目
    --themetype1 选题类别1  01 参考地图 ,02 教材教辅,03 图书,04 电子读物 ,05 特种地图 
    --themetype2 选题类别2 
    --inteid 选题唯一id,statesname 当前状态 
    -- where flowid ='200501060' 表示立项已完成,已经产生了下一步流程“部门分配”。
    
    select 
        a.themeid 选题号,
        cast(a.nthedition as varchar)+'-'+cast(a.nthpress as varchar) 版印次,
        convert(varchar(10),a.declaredate,120) 立项日期,
        a.themetypename 类型,
        a.themetype1name 类别1,
        a.themetype2name 类别2,
        a.editorroomname 编室,
        a.statesname 当前状态,
        convert(varchar(10),b.fagaodate,120) 发稿日期
    from bw_theme a left outer join bw_fagao b
    on a.inteid =b.themeinteid
    where exists(select 1 from bw_themetrack c where c.flowid ='200501060' and c.themeid=a.inteid)
        and a.declaredate is not null
        and not a.themeid like 'C%'

    二、sql语句中left join on 和left outer join on 等的区别

    http://www.cnblogs.com/cy163/archive/2008/10/16/1312920.html

  • 相关阅读:
    关于java.lang.reflect.InvocationTargetException
    Java并发编程(三)后台线程(Daemon Thread)
    Lab 7-2
    Lab 7-1
    Lab 6-3
    Lab 6-2
    Lab 6-1
    Lab 5-1
    Lab 3-4
    Lab 3-3
  • 原文地址:https://www.cnblogs.com/camelroyu/p/4156933.html
Copyright © 2011-2022 走看看