Sure, you are welcome. I know how painful SQL queries can be, but at the
same time it is a beautiful subject.

The final version of the query (as you inserted below) can be used as a
source of information to get findAll().

Sounds like an interesting application you're building there.
Congratulations.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!


-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de Uncle Bill
Enviado el: Martes, 28 de Noviembre de 2006 06:22 p.m.
Para: Cake PHP
Asunto: Re: help with SQL statement


Excellent!

Or (to cut this down to only a WHERE clause that I can feed to
findAll() ):

SELECT * FROM `posts` WHERE `revision` in (SELECT MAX(`revision`) FROM
`posts` AS `p2` WHERE `p2`.`post_id` = `posts`.`post_id` GROUP BY
`post_id`);

Very cool; I didn't realize you could that sort of embedded query that
interacts with it's parent query. Thanks very much, Mariano!



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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