I'm always interested in querying the db the cakephpway.
Thanks.
On Monday, August 27, 2012 10:30:55 PM UTC-4:30, Mark Wratten wrote:
-- On Monday, August 27, 2012 10:30:55 PM UTC-4:30, Mark Wratten wrote:
Figured it out for myself, the subquery just goes in place of the table name.
On Monday, August 27, 2012 6:17:05 PM UTC-4, Mark Wratten wrote:Is there a 'Cake' way of including subqueries in join clauses of SQL select statements?I'm looking to generate something in the form of -SELECT ... FROM table1JOIN (SELECT DISTINCT key FROM table2 WHERE ...) table2 ON table2.key = table1.keyI have been looking at joining tables in the docs, but it only seems to support joining tables rather than expressions. I could move the DISTINCT to the main query, but that does not perform as well, and also messes up pagination.ThanksMark
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
No comments:
Post a Comment