I am trying to get all the rows where start date is above current date or end date is above current date and whitepaper column is null.
For some reason this sql returns what i expect EXCEPT it also returns the rows where whitepaper is NOT NULL, if i turn the sql around and say whitepaper IS NOT NULL it will return everything as expected all the ones where whitepaper is not null and not the ones where whitepaper is null?
The 'And' should it not specify that this has to be fullfilled?
SQL
SELECT id,
name,
whitepaper,
date_start,
date_end
FROM approved
WHERE date_start >= CURDATE() OR date_end >= CURDATE()
AND whitepaper IS NULL
ORDER BY date_end DESC
LIMIT 10