Thursday, December 3, 2009

Re: Converting SQL query into CakePHP using self join

Oh I should mention I need to paginate the results too! :(

On Dec 3, 2:55 pm, "designv...@gmail.com" <designv...@gmail.com>
wrote:
> Hi there,
>
> I need to convert the following:
>
> SELECT *
> FROM `laps`
> WHERE `id` = (
> SELECT `id`
> FROM `laps` AS `alt`
> WHERE `alt`.`user_id` = `laps`.`user_id`
> ORDER BY `lap_time` ASC
> LIMIT 1 )
> ORDER BY `lap_time` ASC
> LIMIT 10
>
> into an on the fly binding and cake 'find all' and I'm having no luck :
> (
>
> could anyone help?
>
> TIA,
> d.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate