It works! I had to fix It a bit: SELECT UserPermission.UserPermissionId, UserPermission.UserPermissionName FROM ( UserPermission INNER JOIN UserPermissionJoin ON UserPermission.UserPermissionID = userPermissionJoin.UserPermissionID ) INNER JOIN User ON UserPermissionJoin.UserID = User.UserID WHERE User.UserID = '1'
UserId is numeric. username is the 'perezd' OKAY. That's awesome! But now I'm back to square one. I am at a loss for words as to how to handle this in reactor?? I imagine I need to setup a relationship in my reactor.xml file...but I don't even know where to begin now...I have never done a multi-join like this. Could you help me reactorify this? You rock! Thanks so much for your help!! - Derek -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Wilson Sent: Wednesday, December 13, 2006 12:06 PM To: [email protected] Subject: Re: [Reactor for CF] understanding IN statements in reactor 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
