毕业预警的SP

代码
create procedure sp_byyujing  
as 
declare @nj integer
--还剩下4年学籍无效,无通过门数少于5门
set @nj=year(getdate())
SELECT dwmc, xsjbdabplus.zymc, xsjbdabplus.bmc,xsjbdabplus.xh,xhjm, xsjbdabplus.xm, 
      xsjbdabplus.dh, byyshsdfb.wtgms,   
case when bysbxf <0 then 0 else bysbxf end as '必修', bysxif as '限修',case when bysxxf <0 then 0 else bysxxf end as '选修'
  
FROM byyshsdfb  JOIN       xsjbdabplus on  byyshsdfb.xh=xsjbdabplus.xh
WHERE (@nj-cast(left(byyshsdfb.xh,4as integer)>5AND (byyshsdfb.wtgms < 5AND 
      (xsjbdabplus.xjztdm 
= '1'
ORDER BY dwmc,bmc,byyshsdfb.xh


GO

 

posted @ 2010-09-09 10:50  步三少  阅读(224)  评论(0编辑  收藏  举报