Skip to content

Instantly share code, notes, and snippets.

@prestarocket
Created May 11, 2020 16:34
Show Gist options
  • Save prestarocket/60f0046bb6a096f8072727648b1e48b0 to your computer and use it in GitHub Desktop.
Save prestarocket/60f0046bb6a096f8072727648b1e48b0 to your computer and use it in GitHub Desktop.
prestashop : category without products
select c.id_category,cl.name
from ps_category c
inner join `ps_category_lang` cl ON cl.id_category = c.id_category
where c.active=1 AND c.id_category NOT IN ( select id_category from `ps_category_product` cp inner join ps_product p ON p.id_product = cp.id_product where p.`active` = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment