On Jan 31, 2008 1:30 PM, Jerry Schwartz <[EMAIL PROTECTED]> wrote:
> That's rather what I feared. I'm trying to avoid code, mostly because this
> should be a one-off run.

If it's a one-shot deal and you don't mind it taking a little time, I
think something like this would work:

SELECT customers.email, COUNT(*) AS n,
GROUP_CONCAT(customers.customer_id), GROUP_CONCAT(memos.memo_ids)
FROM customers
JOIN (
  SELECT customer_id, GROUP_CONCAT(memo_id) AS memo_ids
  FROM memos
  GROUP BY customer_id
) AS memos ON (customers.customer_id = memos.customer_id)
GROUP BY customers.email
HAVING n > 1;

- Perrin

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to