sql case不能与like运算符一起使用 [英] sql case will not working with like operator

查看:302
本文介绍了sql case不能与like运算符一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的场景中

其中

case isvalid

当''true''然后命名为''%a''

结束



错误显示语法不正确

In my scenario
where
case Isvalid
when ''true'' then name like ''%a''
end

error showing "incorrect syntax"

推荐答案

它应该是这样的

it should like this
select * from
tblnm
where name like (case when Isvalid = true then '%a' else '' end)



Happy Coding!

:)


Happy Coding!
:)


这篇关于sql case不能与like运算符一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆