(ver: MySQL 3.23.53) side note: seems to run fairly quick in 4.0.18
SELECT
dl.email as download_email, CONCAT(dl.first, " ", dl.last) as download_name, o.id as orderID,
c.id as cust_id, dl.id as dlId, c.email as customer_email
FROM download_users as dl
LEFT JOIN orders as o ON dl.email = o.email LEFT JOIN customers as c ON (dl.email=c.email OR c.id = o.cust_id OR concat(dl.first, dl.last) = concat(c.bill_first,c.bill_last))
GROUP BY download_email
ORDER BY orderID DESC, cust_id DESC --
<---------------------------------------------------------------> Alex Pilson FlagShip Interactive, Inc. [EMAIL PROTECTED] <--------------------------------------------------------------->
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]