How to use the not equal to statement in MySQL?

In MySQL, the not equal to statement is represented by the operators “!=” or “<>“. Here is an example of using the not equal to statement:

SELECT * FROM 表名 WHERE 列名 != 值;

SELECT * FROM 表名 WHERE 列名 <> 值;

Please note that “!=” and “<>” are equivalent and you can choose to use either based on personal preference.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds