[英]MySQL not equals to - isn't working
I'm trying to use not equal select in PhpMtAdmin 5.6.12, MySQL client version: 5.6.12, but it seems not working: 我试图在PhpMtAdmin 5.6.12中使用不等于select的MySQL客户端版本:5.6.12,但似乎无法正常工作:
I have tried this queries: 我已经尝试过以下查询:
SELECT * FROM table WHERE field <> 05.05.2013
SELECT * FROM table WHERE field <> '05.05.2013'
SELECT * FROM table WHERE field <> "05.05.2013"
SELECT * FROM table WHERE field != 05.05.2013
SELECT * FROM table WHERE field != '05.05.2013'
SELECT * FROM table WHERE field != "05.05.2013"
SELECT * FROM table WHERE field not in ('05.05.2013')
...
I'm getting error message: 我收到错误消息:
ERROR: Unclosed quote @ 38
STR: '
SQL: SELECT * FROM `table` WHERE field <> \'05.05.2013\'
If field is a date column, try this: 如果field是日期列,请尝试以下操作:
SELECT * FROM `table` WHERE field != '2013-05-05'
or this: 或这个:
SELECT * FROM `table` WHERE field != STR_TO_DATE("05.05.2013", "%d.%m.%Y")
(assuming your date is in the format of day.month.year). (假设您的日期采用day.month.year的格式)。
The problem was on PhpMyAdmin 5.6.12. 问题出在PhpMyAdmin 5.6.12上。 "not equals to" works perfect on other environment. “不等于”可以在其他环境下完美运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.