Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET @id = 1;
- SELECT news.*
- FROM news, cats
- WHERE (news.cat_id = cats.cat_id AND
- (
- ((SELECT cats.cat_id FROM cats WHERE cats.cat_id = @id) = cats.cat_id) OR
- ((SELECT cats.subcat_to FROM cats WHERE cats.cat_id = @id) = cats.cat_id) OR
- ((SELECT cats.subsubcat_to FROM cats WHERE cats.cat_id = @id) = cats.cat_id)
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement