Now that I understand your data structures, I understand how to solve the
problem.  I hope this works on MySQL.  I tested it using OpenOffice.orgBase.

SELECT users.user_id
    , users.user_name
    , docs.doc_id
    , docs.doc_name
    , user_docs.signoff_id
FROM users, docs
    LEFT OUTER JOIN user_docs
        ON users.user_id = user_docs.user_id
        AND docs.doc_id = user_docs.doc_id
WHERE user_docs.signoff_id IS NULL

On Mon, Mar 10, 2008 at 10:01 AM, Josh McKinley <[EMAIL PROTECTED]> wrote:

> I think you've made a bit of an error there. With inner joins, the query
> returns no results. This is what I expected. Using a left outer join also
> returns no rows. This makes sense as you're maintaining the rows from the
> wrong table. Changing it to a right outer join creates a cross dependency
> error.
>
> The user table has all of the users. The doc table has all of the docs.
> The
> user_doc table has one entry for each time a user has signed off on having
> read a document. A row is inserted with the user id and the doc id.
>
> What I'm trying to return is the users who have not signed off on viewing
> one or more documents and the documents on which they've failed to sign
> off.
>
>
>
>
>
>
> Subject: query help
> From: Sonny Savage
> Date: Mon, 10 Mar 2008 08:39:57 -0400
> Thread:
>
> http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55471#300843
>
> Question: Do you also want a result in the case where there is no
> USER_DOCS
> record for a given USER and DOC record (FULL OUTER JOIN)?
>
> On Sat, Mar 8, 2008 at 12:12 AM, Josh McKinley <[EMAIL PROTECTED]> wrote:
> ----- Excess quoted text cut - see Original Post for more -----
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300859
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to