Guest User

Untitled

a guest
Dec 10th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // query to select all article entries that are
  2. // not in translation-system and are only english
  3.  
  4. SELECT `a`.*
  5. FROM se_articles AS `a`
  6. WHERE `a`.`article_id` NOT IN (
  7. SELECT `at`.`article_id`
  8. FROM `se_articles_translations` AS `at`
  9. WHERE `at`.`article_id` = `a`.`article_id`
  10. )
  11. AND `a`.`article_id` IN (
  12. SELECT `ats`.`tag_object_id`
  13. FROM `se_articletags` AS `ats`
  14. WHERE `ats`.`tag_name` = "english"
  15. )
  16.  
  17.  
  18. // query to select all article entries that are
  19. // not in translation-system and are only german
  20.  
  21. SELECT `a`.*
  22. FROM se_articles AS `a`
  23. WHERE `a`.`article_id` NOT IN (
  24. SELECT `at`.`article_id`
  25. FROM `se_articles_translations` AS `at`
  26. WHERE `at`.`article_id` = `a`.`article_id`
  27. )
  28. AND `a`.`article_id` IN (
  29. SELECT `ats`.`tag_object_id`
  30. FROM `se_articletags` AS `ats`
  31. WHERE `ats`.`tag_name` = "english"
  32. OR `ats`.`tag_name` = "deutsch"
  33. )
Add Comment
Please, Sign In to add comment