我的查询是
DECLARE @AutoApprove BIT
SET @AutoApprove = (
SELECT AutoApprove
FROM dbo.CommentBox_Setting
WHERE UserModuleID = @myModuleID
AND PortalID = @portalID
AND CultureCode = @cultureCode
)
由此我将得到 1 或 0(真或假)此外我有
SELECT * FROM ComentBox_Comment
WHERE UpperModuleID = @UpperModuleID
AND ModuleID = @myModuleID
AND portalID = @portalID
AND cultureCode = @cultureCode
AND //Here i need to check condition
(IF(@AutoApprove=0){ THEN isapprove=1}else {do not check})
注意这里isapprove是表filedName
我知道,我可以用长查询来做到这一点,我需要简短而简单的方法。帮帮我。