Skip to content

Instantly share code, notes, and snippets.

@aj-justo
Created May 30, 2011 14:50
Show Gist options
  • Save aj-justo/999000 to your computer and use it in GitHub Desktop.
Save aj-justo/999000 to your computer and use it in GitHub Desktop.
Zen Cart: Select all products in a main category AND its subcategories (with a level 2 nesting)
SELECT *
FROM products_to_categories
WHERE categories_id
IN (
SELECT categories_id
FROM categories
WHERE parent_id
IN (
SELECT categories_id
FROM categories
WHERE categories_id =100094
OR parent_id =100094
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment