El 14/12/2011 9:27, amvis escribió/wrote:
Quote:
This is i tried the query join with sub-query..i think it have some syntax error...?
select count(*)
from (
SELECT transactions.loyalty_id FROM transactions JOIN loyalties ON (transactions.loyalty_id = loyalties.id) GROUP BY transactions.loyalty_id HAVING COUNT(*)>1 where loyalties.created_at> '2011-11-02'
) as t |
When a query has a syntax error, MySQL will tell you so. Run the query
and read the error message if any.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--