我需要这样做
DELETE FROM konta WHERE taken != ''
Run Code Online (Sandbox Code Playgroud)
但是!=在mysql中不存在.有人知道怎么做吗?
Mar*_*ers 30
该!=操作肯定是存在的!它是标准<>运算符的别名.
也许你的字段实际上不是空字符串,而是NULL?
为了比较NULL,你可以使用IS NULL或IS NOT NULL或空安全等于运营商<=>.
min*_*s23 11
您可能正在使用旧版本的Mysql但肯定可以使用
DELETE FROM konta WHERE taken <> ''
Run Code Online (Sandbox Code Playgroud)
但是还有很多其他选择.您可以尝试以下方法
DELETE * from konta WHERE strcmp(taken, '') <> 0;
DELETE * from konta where NOT (taken = '');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
107032 次 |
| 最近记录: |