I’m a bit confused why I am getting rows where senMatches = ‘No’ and lastMatch = '2012-09-27’. Any thoughts?
Thanks!
SELECT
u.uID,
u.firstName,
u.lastName,
u.email,
u.sendMatches,
date_format(u.lastMatch, '%m-%d-%Y') as lastMatch,
s.sID,
date_format(s.searchDate, '%m-%d-%Y') as searchDate,
s.uID,
s.type,
s.keyword,
s.alerts,
date_format(s.lastAlert, '%m-%d-%Y') as lastAlert,
s.clicks,
date_format(s.lastClick, '%m-%d-%Y') as lastClick,
date_format(u.lastLogin, '%m-%d-%Y') as lastLogin
FROM searches s
LEFT JOIN users u
ON s.uID = u.uID
WHERE MATCH (keyword) AGAINST ('sport' in boolean mode) or keyword in ('')
and u.sendMatches = 'Yes'
and u.bouncing = 'No'
and date(u.lastMatch) <> '2012-09-27'
and s.type in ('basic', 'advanced')
GROUP BY
u.uID
ORDER BY
s.searchDate