translate SQL query (with subquery) into cake style query
I have this SQL query:
SELECT * FROM books AS Book
INNER JOIN authors AS Author ON Author.id = Book.author_id
LEFT JOIN (SELECT bu.book_id, bu.user_id FROM books_users AS bu
WHERE bu.user_id = xyz) AS bud ON Book.id = bud.book_id
ORDER BY Book.owners DESC LIMIT 5
I have read http://book.cakephp.org/view/1030/Complex-Find-Conditions
but I haven't understand nothin and I don't know how rewrite this
query in cakephp style.
Who help?
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