Converting SQL query into CakePHP using self join
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