use IS NULL
or IS NOT NULL
to compare NULL
values because they are simply unknown.
SELECT name
from products p
WHERE backorder IS NULL OR backorder <> 2
More Related Contents:
- How can I return pivot table output in MySQL?
- Using LIMIT within GROUP BY to get N results per group?
- How to perform grouped ranking in MySQL
- Required to join 2 tables with their FKs in a 3rd table
- MySQL Trigger after update only if row has changed
- Does COUNT(*) always return a result?
- Ordering by specific field value first
- MySQL “Group By” and “Order By”
- How to change the CHARACTER SET (and COLLATION) throughout a database?
- MySQL Query to select data from last week?
- Connect By Prior Equivalent for MySQL
- Mysql::Error: Specified key was too long; max key length is 1000 bytes
- How to convert all tables from MyISAM into InnoDB?
- How can I get around MySQL Errcode 13 with SELECT INTO OUTFILE?
- Are there disadvantages to using a generic varchar(255) for all text-based fields?
- SQL Query to show nearest date?
- How to create relationships in MySQL
- Getting all parent rows in one SQL query
- Mysql Improve Search Performance with wildcards (%%)
- ALTER TABLE to add a composite primary key
- Second SELECT query if first SELECT returns 0 rows
- Difference between two table structure
- Difference between SET autocommit=1 and START TRANSACTION in mysql (Have I missed something?)
- How to retrieve JSON data from MySQL?
- MySQL equivalent of Oracle’s SEQUENCE.NEXTVAL
- Why MySQL is giving error “Not allowed to return a result set from a function”?
- When to use a left outer join?
- Optimistic locking in MySQL
- Insert and set value with max()+1 problems
- comparison of truncate vs delete in mysql/sqlserver [duplicate]