I'm looking to generate something in the form of -
SELECT ... FROM table1
JOIN (SELECT DISTINCT key FROM table2 WHERE ...) table2 ON table2.key = table1.key
I 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.
Thanks
Mark
-- 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