Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi everyone,
I have orders with a missing shipped_at value, but this query returns no rows:
SELECT *
FROM orders
WHERE shipped_at = NULL;
What is the correct way to find orders that have no shipping timestamp?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Use IS NULL. Comparing a value to NULL with = produces an unknown result, and WHERE only keeps rows where the condition is true.
SELECT *
FROM orders
WHERE shipped_at IS NULL;