MySQL WHERE: how to write “!=” or “not equals”?

前端 未结 3 705
慢半拍i
慢半拍i 2020-12-23 20:23

I need to do this

DELETE FROM konta WHERE taken != \'\'

But != doesn\'t exist in mysql. Anyone know how to do this?

3条回答
  •  离开以前
    2020-12-23 21:00

    You may be using old version of Mysql but surely you can use

     DELETE FROM konta WHERE taken <> ''
    

    But there are many other options available. You can try the following ones

    DELETE * from konta WHERE strcmp(taken, '') <> 0;
    
    DELETE * from konta where NOT (taken = '');
    

提交回复
热议问题