SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER procedure CombinedSearch
@StartTime smalldatetime,
@EndTime smalldatetime,
@empState varchar(100)= null
as
if @empState <> null
select * from jobseeker
where (@StartTime <=InterviewTime and @EndTime> =InterviewTime) and [email protected]
else if @empState=null
select * from jobseeker
where (@StartTime <=InterviewTime and @EndTime> =InterviewTime)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
[email protected]?[email protected]?[email protected]?的结果的。请各位看看。
------解决方案--------------------
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER procedure CombinedSearch
@StartTime smalldatetime,
@EndTime smalldatetime,
@empState varchar(100)= null
as
if @empState is not null
select * from jobseeker
where (@StartTime <=InterviewTime and @EndTime> =InterviewTime) and [email protected]
else if @empState is null
select * from jobseeker
where (@StartTime <=InterviewTime and @EndTime> =InterviewTime)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
------解决方案--------------------
汗, 不能用 <> NULL, =NULL 來判斷的