Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select,
- f.*,
- fp.*
- from
- forums f
- inner join
- forum_permissions fp on f.forum_id = fp.forum_id
- where
- f.parent_id = -1 and f.forum_view = 1 and fp.group_id in (1,2,3)
- group by
- f.forum_id;
- -- more readable but i've assumed group_id is a field in fp as your orginal code doesnt state
- select,
- f.*,
- fp.*
- from
- forums f
- left outer join
- forum_permissions fp on f.forum_id = fp.forum_id
- where
- f.parent_id = -1 and f.forum_view = 1 and fp.group_id in (1,2,3)
- group by
- f.forum_id;
Add Comment
Please, Sign In to add comment