判断语句

SQL 里面判断语句 用一个"="号 表示是否相等

 

代码
alter PROCEDURE LatestDealConfig

(
@SDate datetime,
@EDate datetime
)

AS

if (datediff(second,@EDate,@SDate)=0)
begin

SELECT
*
FROM Sms_Receive
WHERE (Content LIKE
'%#%') and Submit_time<@EDate
ORDER BY Submit_time DESC

end

else

begin

SELECT
*
FROM Sms_Receive
WHERE (Content LIKE
'%#%') and Submit_time >=@SDate and Submit_time<@EDate
ORDER BY Submit_time DESC

end

 

posted @ 2010-02-22 11:36  Sue_娜  阅读(106)  评论(0编辑  收藏  举报