CREATE FUNCTION [dbo].[f_recommendCondition]
(
@views INT ,
@replies INT ,
@digest TINYINT
)
RETURNS INT
AS
BEGIN
DECLARE @returnValue INT ;
IF ( @digest IN ( 1, 2, 3, 10 )
AND @views > 99
AND @replies > 9
)
SET @returnValue = 1
ELSE
SET @returnValue = 0
RETURN @returnValue ;
END