Skip to content

Instantly share code, notes, and snippets.

@moltar
Created December 30, 2012 02:21
Show Gist options
  • Save moltar/4410624 to your computer and use it in GitHub Desktop.
Save moltar/4410624 to your computer and use it in GitHub Desktop.
complex join
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