Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. select * from (
  2. SELECT DISTINCT ON(article_id)*
  3. FROM articles_categories
  4. WHERE (article_id <> 88963
  5. AND
  6. category_id IN (4, 53630, 62355, 57177, 24, 53676, 69494, 69484, 69386, 11, 56820, 69617))
  7. ) as ca
  8. INNER JOIN articles ON ca.article_id = articles.id
  9. WHERE articles.article_type = 0
  10. AND
  11. articles.is_closed = false
  12. ORDER BY articles.publication_date DESC
  13. LIMIT 5;
Add Comment
Please, Sign In to add comment