Created
December 30, 2012 02:21
-
-
Save moltar/4410624 to your computer and use it in GitHub Desktop.
complex join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
from products p | |
left join product_custom_fields pcf1 on p.id = pcf1.product_id and pcf1.custom_field_id = 1 | |
left join product_custom_fields pcf2 on p.id = pcf2.product_id and pcf2.custom_field_id = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment