Skip to content

Instantly share code, notes, and snippets.

@gmacdougall
Created December 14, 2017 21:18
Show Gist options
  • Save gmacdougall/82a45e37307a17304342da363759873e to your computer and use it in GitHub Desktop.
Save gmacdougall/82a45e37307a17304342da363759873e to your computer and use it in GitHub Desktop.
SELECT DISTINCT tommy_john_filter_values.id,
tommy_john_filter_values.name,
spree_variants.id
FROM tommy_john_filter_values
INNER JOIN tommy_john_filter_values_colors
ON (tommy_john_filter_values_colors.filter_value_id = tommy_john_filter_values.id)
INNER JOIN spree_variants
ON (spree_variants.color_id = tommy_john_filter_values_colors.color_id)
WHERE spree_variants.product_id = 98683658;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment