Skip to content

Instantly share code, notes, and snippets.

@steverobbins
Last active February 20, 2018 12:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steverobbins/cb8370c831e5ad937ab8 to your computer and use it in GitHub Desktop.
Save steverobbins/cb8370c831e5ad937ab8 to your computer and use it in GitHub Desktop.
select p1.sku `parent sku`, group_concat(p2.sku) `associated skus`, lt.code `type`
from catalog_product_link l
inner join catalog_product_entity p1 on p1.entity_id = l.product_id
inner join catalog_product_entity p2 on p2.entity_id = l.linked_product_id
inner join catalog_product_link_type lt on l.link_type_id = lt.link_type_id
group by l.product_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment