Ok, I need some help with a join. I'm close to what I need, but its not
exactly there. I have some a table called Queues which is basically an
account. Then I have a Users table with my users. I then have a third table
which allows for Users and Queues to be linked together. Here are sample
tables:

Queues
ID        Name
1          Queue1
2          Queue2

Users
ID        Username
1          User1
2          User2

UserQueues
UserID        QueueID    AccessID
1                 2                 0
2                 1                 2
2                 2                 1

As you can see, in the UserQueues table, user 1 is only linked to Queue2. He
may not have a link to Queue 1. What I need is to select User 1 and ALL
Queues so I get a result like this:

UserID       QueueID    AccessID
1                 2                0
1                 1                NULL

Here is my query now, but all it returns are rows in which there are entries
in the UserQueues table.

SELECT Q.QueueID, AccessID, Q.QueueName
FROM Queues Q
   RIGHT JOIN SecurityXrefUserQueues XUQ
    ON XUQ.QueueID = Q.QueueID
WHERE XUQ.UserID = #url.uid#

Anyone have any idea how I can get the above result that I need?

Cedric


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to