I have this query:
SELECT * FROM (`users`) WHERE `date_next_payment` <= \'2011-02-02\' AND `status` = \'active\' OR `status` = \'past due\' >
SELECT * FROM (`users`) WHERE `date_next_payment` <= \'2011-02-02\' AND `status` = \'active\' OR `status` = \'past due\'
It is not special about SQL, it is about boolean logic. Your 1st statement is:
a AND b OR c
That means if any c is true, you get the row.
In a AND (b OR c)
you get only rows where a is true and (b or c) is true.