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

前端 未结 3 707
慢半拍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

    The != operator most certainly does exist! It is an alias for the standard <> operator.

    Perhaps your fields are not actually empty strings, but instead NULL?

    To compare to NULL you can use IS NULL or IS NOT NULL or the null safe equals operator <=>.

提交回复
热议问题