case...when...then...不能返回布尔值吗?

yundanfengqing 2003-10-27 06:14:25
select A.registerDate as 登记日期,B.productType as 产品类型
from zcht_tz as A full outer join zcht_hk as B on A.htHao=B.htHao
where
(
case when B.sumLaiKuan<A.yuFuKuan
then true
else false
end
)
总是报语法错误!!各位给点意见。。。
...全文
111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
LoveSQL 2003-10-27
  • 打赏
  • 举报
回复
--加上单引号就好了
select A.registerDate as 登记日期,B.productType as 产品类型
from zcht_tz as A full outer join zcht_hk as B on A.htHao=B.htHao
where
(
case when B.sumLaiKuan<A.yuFuKuan
then 'true'
else 'false'
end
)
pengdali 2003-10-27
  • 打赏
  • 举报
回复
select A.registerDate as 登记日期,B.productType as 产品类型
from zcht_tz as A full outer join zcht_hk as B on A.htHao=B.htHao
where 1=

case when B.sumLaiKuan<A.yuFuKuan
then 1
else 0
end

34,875

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧