MySQL Forums
Forum List  »  Newbie

Re: Help in a complex JOIN statement
Posted by: Comrax Ltd.
Date: May 10, 2005 02:49PM

Hi again,

Look at the following statement which I wrote. It almost does the trick, but still it gives back relevant results from content tables:

SELECT
DISTINCT articles.*, publishers.*
FROM
privileges
INNER JOIN
articles
ON
rec_id NOT IN (articles_id)
INNER JOIN
publishers
ON
rec_id NOT IN (publishers_id)
WHERE
(
req_type='G' AND
req_id IN ('user_group1','user_group2','user_group3') AND
obj_type IN ('T') AND
obj_id IN ('articles') AND
action IN ('SEL') AND
priv='0'
) OR
(
req_type='G' AND
req_id IN ('user_group4','user_group5') AND
obj_type IN ('T') AND
obj_id IN ('publishers') AND
action IN ('SEL') AND
priv='0'
) OR
(
req_type='U' AND
req_id IN ('a_user') AND
obj_type IN ('T') AND
obj_id IN ('articles', 'publishers') AND
action IN ('SEL') AND
priv='0'
)

The query works on returning relevant records from 'articles' (those that are not denied access in 'privileges') but fails to strip off relevant records from 'publishers' (although being denied access in 'privileges')

Anyone?

Options: ReplyQuote


Subject
Written By
Posted
Re: Help in a complex JOIN statement
May 10, 2005 02:49PM


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.