From: Ian S. <Ian...@et...> - 2004-05-28 17:28:38
|
Ian Sparks wrote: > AFAIK SQLObject can't do complex joins. to which Ian Bicking wrote: > >Ah, and that is where you are wrong! > >TimeOffRequests.select(AND(TimeOffRequests.q.cUserID =3D=3D = Users.q.cID, > Users.q.Dept =3D=3D 12)) I stand corrected and humbled! Thanks. -----Original Message----- From: Ian Bicking [mailto:ia...@co...] Sent: Friday, May 28, 2004 12:21 PM To: Ian Sparks Cc: Sqlobject-Discuss@Lists. Sourceforge. Net (E-mail) Subject: Re: [SQLObject] Passthrough SQL. Ian Sparks wrote: > Before I start digging into the source code does the following > ability already exist in SQLObject and, if not, does anyone else want > it. >=20 > AFAIK SQLObject can't do complex joins. For instance, I might want to > do a query like : >=20 > SELECT TimeOfRequests.* FROM TimeOffRequests INNER JOIN Users ON > TimeOffRequests.cUserID =3D Users.cID WHERE Users.Dept =3D 12 Ah, and that is where you are wrong! TimeOffRequests.select(AND(TimeOffRequests.q.cUserID =3D=3D Users.q.cID, Users.q.Dept =3D=3D 12)) You can also do: TimeOffRequests.select("TimeOffRequests.cUserID =3D Users.cID AND=20 Users.Dept =3D 12", clauseTables=3D['Users']) I imagine there are probably more complex queries that won't work, but=20 one at a time... Ian |