Advertisement
aaa4Alex

Select by to categories

Sep 11th, 2020
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.27 KB | None | 0 0
  1. SELECT a.id, a.title
  2. FROM article a
  3.          JOIN (SELECT ac.article_id FROM article_category ac WHERE ac.category_id = '32') t1 ON t1.article_id = a.id
  4.          JOIN (SELECT ac.article_id FROM article_category ac WHERE ac.category_id = '34') t2 ON t2.article_id = a.id;
  5.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement