鉴于此 T-SQL 代码:
SELECT CASE
WHEN ( Cast (CASE
WHEN Isnull(bpe.new, 0) = 0
AND Isnull(bpe.regular, 0) = 0
AND Isnull(bpe.bargain, 0) = 0 THEN 0
ELSE 1
END AS BIT)
AND @siteID IS NULL
OR bpe.siteid = @siteID ) THEN 1
ELSE 0
END AS SiteHasBrandException
FROM brandpromoexceptions AS bpe
我收到错误消息:
在预期条件 TSQL 的上下文中指定的非布尔类型的表达式
这是为什么?