I'm running a query that is grabbing 2 groups of people that meet one criteria or another, ie:

SELECT a.user_id, n.mailerdate, n.mailername, p.datepurchased
FROM userdb a, purchase p, mailerlists n, (select max(u.dt) as maxdate, u.user_id FROM uservisit u group by u.user_id ) z
WHERE a.user_id = p.user_id(+)
AND a.user_id = z.user_id(+)
AND ((z.maxdate > n.mailerdate) or (p.datepurchased > n.mailerdate))

The 2 criteria are 1: if the last visit (maxdate) is GT the mailerdate OR 2: They have a purchase (datepurchased) GT the mailerdate. The query runs fine, my only issue is being able to differentiate the 2 groups in the output, and defining WHY they are displayed (which criteria they met).

Any help is greatly appreciated.