讨教一个sql查询

MySql 码拜 8年前 (2016-02-16) 800次浏览
表tmp里有一条记录
|value|
|Open unfamiliar number of intelligent recognition capabilities, to prevent harassing phone calls And SMS. \nTip:Need to connect to the network and location information|
为什么
select * from tmp where value = “Open unfamiliar number of intelligent recognition capabilities, to prevent harassing phone calls And SMS. \nTip:Need to connect to the network and location information”
查不到呢?
返回为空!
谢谢
解决方案

10

你是直接把数据复制到sql语句中,然后查询,返会空是吗?
本人觉得,应该是由于字符串中有一些特殊字符,例如换行符等,但是你在sql语句中的字符串可能没有这个,例如回车等符号

10

用like “Open unfamiliar%” 多试试

10

语句里\n好像是特殊字符,用value like ‘%Open%’ 这种方法

10

有\n特殊字符,需要转义

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明讨教一个sql查询
喜欢 (0)
[1034331897@qq.com]
分享 (0)