MySQL Forums
Forum List  »  InnoDB

Re: help in formatting a query
Posted by: Tyler Hains
Date: June 08, 2005 12:26PM

I'm not 100% clear on what you're trying to accomplish, but I think you can do what you want with a join and use of 'OR'. You may want to start with something like this:

select a.* from article a left join audience_members m on (a.article_id = m.article_id and m.member_id = '$currentUserID')
where a.submitter_id = '$currentUserID'
OR ( a.audiencescope = 2 AND m.member_id in ('2', '4', '6'))

Hope this helps,
Tyler

Options: ReplyQuote


Subject
Views
Written By
Posted
2651
May 30, 2005 06:59PM
Re: help in formatting a query
2033
June 08, 2005 12:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.