日期:2014-05-18 浏览次数:20513 次
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO -- ================================ -- ================================ ALTER PROCEDURE [dbo].[usp_OQC_BadChart] ( @B_Yer varchar(4), @B_Month varchar(2), --@B_Type varchar(30), @B_Class char(1) ) AS if(@B_Class=='1') { select BadContent,count(1) as BNO from T_OQC_ProductionPlan where Year(OQCTime)=@B_Yer and month(OQCTime)=@B_Month and BadContent!='无' and Models like 'DVS%' group by BadContent } else { select BadContent,count(1) as BNO from T_OQC_ProductionPlan where Year(OQCTime)=@B_Yer and month(OQCTime)=@B_Month and BadContent!='无' and Models like 'DXM%' group by BadContent }
ALTER PROCEDURE [dbo].[usp_OQC_BadChart] ( @B_Yer varchar(4), @B_Month varchar(2), --@B_Type varchar(30), @B_Class char(1) ) AS if(@B_Class='1') select BadContent,count(1) as BNO from T_OQC_ProductionPlan where Year(OQCTime)=@B_Yer and month(OQCTime)=@B_Month and BadContent!='无' and Models like 'DVS%' group by BadContent else select BadContent,count(1) as BNO from T_OQC_ProductionPlan where Year(OQCTime)=@B_Yer and month(OQCTime)=@B_Month and BadContent!='无' and Models like 'DXM%' group by BadContent
------解决方案--------------------
declare @i int set @i=1 if(@i=1) --用一个等号就行 select 'a'