Hows this?

I had to guess at your key on UserPermissionJoin. Assuming
UserPermissionJoin has aUserID column as well as a UserPermissionID
column, this is all set.


SELECT UserPermissionId, UserPermissionName
FROM ( UserPermission
INNER JOIN UserPermissionJoin ON UserPermission.UserPermissionID =
userPermission.UserPermissionID )
 INNER JOIN User ON UserPermissionJoin.UserID = User.UserID
WHERE UserID = 'perezd'



On 12/13/06, Derek P. <[EMAIL PROTECTED]> wrote:
I have not had very much experience with joins...how would you recommend
doing that?

Thanks!

- Derek

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dan Wilson
Sent: Wednesday, December 13, 2006 5:45 AM
To: [email protected]
Subject: Re: [Reactor for CF] understanding IN statements in reactor

You should be able to rewrite that query from subselects to using
joins. I'd recommend that for your use case. Apart from the ease in
doing it with reactor, you can help speed up the query.


dw

On 12/13/06, Derek P. <[EMAIL PROTECTED]> wrote:
>
>
>
>
> In my quest to learn how to use reactor better J I have another SQL
> statement I am having hard time deciphering how I should approach this,
> because its not necessarily a join.but.well check this out.
>
>
>
>
>
> Heres the SQL:
>
>
>
>
>
> SELECT userPermissionId, userPermissionName FROM userPermission
>
> WHERE UserPermissionId IN (SELECT UserPermissionId FROM userPermissionJoin
> Where UserID IN (SELECT UserID from User where UserName = 'perezd'))
>
>
>
> I basically want to be able to supply what the username is and be able to
> get the permissions they have attached to their account via the
> userPermissionJoin table.
>
>
>
>
>
> Any ideas on where I should begin to start? I figured inside the IN I
would
> create another gateway to the userPermissionJoin.but I don't know what I'd
> do after that.
>
>
>
> Any suggestions friends?? J
>
>
>
>
>
> Thanks for your help!
>
>
>
>
>
> - Derek
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at:
> http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- --


--
"Come to the edge, he said. They said: We are afraid. Come to the
edge, he said. They came. He pushed them and they flew."

 Guillaume Apollinaire quotes


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --





-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --




--
"Come to the edge, he said. They said: We are afraid. Come to the
edge, he said. They came. He pushed them and they flew."

Guillaume Apollinaire quotes


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to