码迷,mamicode.com
首页 > 其他好文 > 详细

456789

时间:2014-08-19 10:39:43      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:des   style   io   ar   art   div   line   ad   

SELECT B.DESCRIPTION,B.PLANNAME,COUNT(*) 案件數

FROM CASES A JOIN 

    (

        select b.DESCRIPTION,a.PLANNAME,MAX(PLANSN) PLANSN

        from [PLAN] a left join PLANTYPE b on a.TYPEID = b.TYPEID

        WHERE PLANNAME NOT LIKE ‘%停%‘ AND PLANNAME NOT LIKE ‘%測%‘

        GROUP BY  b.DESCRIPTION,a.PLANNAME

     ) B ON A.PLANSN = B.PLANSN

WHERE B_DATETIME >= ‘2013/1/1‘ and B_DATETIME <= ‘2013/4/30‘

GROUP BY B.DESCRIPTION,B.PLANNAME

ORDER BY 1

456789,布布扣,bubuko.com

456789

标签:des   style   io   ar   art   div   line   ad   

原文地址:http://www.cnblogs.com/jerain6312/p/3921321.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!