I have a problem with this query

Version MySQL 4.0.15-nt

The query gets all articles written by author but excludes those articles
which are related to products

SELECT DISTINCT
        post.post_id,
        post.title
FROM
        c_posts post,
        c_post_product prod,
        authors_relation rel,
        c_post_properties prop
WHERE
        rel.post_id != '$nPostId' // This is the post_id of the post which
is currently being viewed ( works )
AND
        rel.author_id = '$nAuthorId' // The author_id of the Author
AND
        post.post_id = rel.post_id // To connect the two tables
AND
        post.post_id = prop.post_id // The properties table
AND
        post.post_id <> prod.post_id // This is where the problem is. I've
also tried != . Details below**
AND
        prop.state != 3

** I don't get any errors but the query just doesn't Exclude those post_id's
which are in the c_post_product table which should be the case.
** I've also tried the NOT IN "function", but I get errors when trying that.
Seems like it's not supported by my version ??

The tables are basically as follows
c_posts
        post_id
        title
        content

c_post_product
        post_id
        product_id

authors_relation
        author_id
        post_id

c_post_properties
        post_id
        And some other fields

Suggestions and help -> very much appriciated !!








-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to