Hello,

I am new to CakePHP. Everything has been running smoothly so far, with
simple SQL requests and data retrieval with the $conditions variable.
However I am stuck now with this query that I would like to be put
into the $conditions variable. I don't want to redefine a paginate
function which for sure won't be as cool as the core one...

SELECT *
FROM (
        SELECT clients.*, SUM(sub.price) AS price
        FROM clients LEFT OUTER JOIN (
                SELECT appointments.client_id, services.price
                FROM services, appointments
                WHERE appointments.service_id = services.id
                AND DATE(appointments.datetime) >= '2009-06-23'
                AND DATE(appointments.datetime) <= '2009-06-23') AS sub
        ON (sub.client_id = clients.id)
        GROUP BY clients.id) AS dummy
WHERE price >= 100
AND price <= 200

Tell me this is possible :( Any help greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to