Re: Proper parens in OR searches

2004-08-11 Thread Scott Haneda
on 8/11/04 9:48 PM, Michael Stassen at [EMAIL PROTECTED] wrote: > With parens: > >SELECT id, name FROM listmail >WHERE date_time > DATE_SUB(NOW(), INTERVAL 30 DAY) >AND (subject = 'semaphore' > OR subject = 'Re: semaphore' > OR subject = 'Re:semaphore') >ORDER BY id ASC

Re: Proper parens in OR searches

2004-08-11 Thread Michael Stassen
Scott Haneda wrote: This SQL in mysql 4 is too aggressive and seems to ignore my 30 day date range, if I remove the AND it finds the date range I want, putting it back in does not. I have tried various ways of wrapping ( and ) in the SELECT to no avail. Because AND takes precedence over OR. I am t

Proper parens in OR searches

2004-08-11 Thread Scott Haneda
This SQL in mysql 4 is too aggressive and seems to ignore my 30 day date range, if I remove the AND it finds the date range I want, putting it back in does not. I have tried various ways of wrapping ( and ) in the SELECT to no avail. I am trying to get all records where the subject is one of the