> 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

You could use an intermediate or temp table to return your
desired result set like this:
/* create temp table with one row for each queueid for each
userid */
select u.id as userid, q.id as queueid
into #t1
from users u, queues q
GO

/* this will provide the result you described */
select #t1.*, uq.accessid
from #t1 left outer join userqueues uq
on #t1.userid=uq.userid and #t1.queueid=uq.queueid
order by #t1.userid, #t1.queueid
GO

drop table #t1
GO

There are probably other, better ways to do this but I hope this
may help you.

Regards,
Stephen
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to