daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select,
  2.  f.*,
  3.  fp.*
  4. from
  5.  forums f
  6. inner join
  7.  forum_permissions fp on f.forum_id = fp.forum_id
  8. where
  9.  f.parent_id = -1 and f.forum_view = 1 and fp.group_id in (1,2,3)
  10. group by
  11.  f.forum_id;
  12.  
  13. -- more readable but i've assumed group_id is a field in fp as your orginal code doesnt state
  14.  
  15.  
  16. select,
  17.  f.*,
  18.  fp.*
  19. from
  20.  forums f
  21. left outer join
  22.  forum_permissions fp on f.forum_id = fp.forum_id
  23. where
  24.  f.parent_id = -1 and f.forum_view = 1 and fp.group_id in (1,2,3)
  25. group by
  26.  f.forum_id;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top