为什么在JSON字符串中使用类似查询的选择?
我可以找到此查询,
SELECT *
FROM Table
WHERE CODE_DESC = '{"title:\["1","2","3"\]"}'
但是,我找不到此查询
SELECT *
FROM Table
WHERE CODE_DESC LIKE '%{"title:\["1","2","3"\]"}%'
是什么不同?
我尝试这样的尝试:
SELECT *
FROM Table
WHERE CODE_DESC LIKE '% {"title:\["1","2","3"\]"} %'
SELECT *
FROM Table
WHERE CODE_DESC LIKE '%{"title:\["1","2","3"\]"}%'
但是,我无法解决问题
I can find whit this query
SELECT *
FROM Table
WHERE CODE_DESC = '{"title:\["1","2","3"\]"}'
But, I can't find this query
SELECT *
FROM Table
WHERE CODE_DESC LIKE '%{"title:\["1","2","3"\]"}%'
What is different?
I tried like this:
SELECT *
FROM Table
WHERE CODE_DESC LIKE '% {"title:\["1","2","3"\]"} %'
SELECT *
FROM Table
WHERE CODE_DESC LIKE '%{"title:\["1","2","3"\]"}%'
but, I can't solve the issue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 sql-server 中,您需要转义类似的
[]
,请参阅:LIKE (Transact-SQL)这也有效(替换
[
by 和_
,匹配任何单个字符:In sql-server you need to escape the
[]
in a like, see: LIKE (Transact-SQL)This works too (replacing the
[
by and_
, which matches any single character: