When I run Query 1 query, I expected the query will return me only rows with refunded = False
. But it also returns rows with refunded = Null
.
SELECT *
FROM users u
LEFT JOIN purchases p
ON u.id = p.user_id
AND refunded = FALSE
But when I run query 2, it returns me rows with refunded = false
(no null rows):
SELECT u.id, status, refunded
FROM users u
LEFT JOIN purchases p
ON u.id = p.user_id
WHERE
refunded = FALSE
Can someone please explain me this?