Trying to do a mailout from customer table, tried to use SELECT DISTINCT but this didn't work.
The customer table has duplcates of the email address so I want to extract the one used in the most resent last_visit field.
This is something like what I'm after:
+ email_address AS opt_out_link,
(opt_in_email = 1 AND
email_address NOT LIKE 'ignore@%' AND
email_address NOT LIKE '%@x.com' AND
email_address NOT LIKE '%@y.com' AND
email_address NOT LIKE '%@z.com')
Many thanks in advance :-)