mySQL query syntax error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am getting the following error message:

#1054 - Unknown column 'customers.email' in 'order clause'

from the query below --- I don't understand why.  Would someone help me
please?  Ron


SELECT 'first_name', 'last_name', 'email'
FROM (

(

SELECT `firstname` , `lastname` , `buyer_email` 
FROM `paypal_payment_info` 
WHERE `datecreation` = '$two_weeks_ago'
GROUP BY `buyer_email` 
)
UNION ALL (

SELECT `mail_order_address`.`first_name` ,
`mail_order_address`.`last_name` , `mail_order_address`.`email` 
FROM `mail_order_address` 
INNER JOIN `mail_order_payment` ON `mail_order_address`.`reference` =
`mail_order_payment`.`mail_order_address_reference` 
WHERE `mail_order_payment`.`payment_received` = '$two_weeks_ago'
GROUP BY `mail_order_address`.`email` 
)
) AS customers
ORDER BY `customers`.`email` ASC 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux