Got it now. In fact, I think this example is more meaningful than the one
currently in the book to illustrate why one would want to nest select into
belongs. Thanks.
On Wednesday, September 25, 2013 8:29:53 AM UTC+2, Niphlod wrote:
>
> it's explained pretty well on the book
>
>
> http://web2py.c
Hey guys this works a treat and I have learned something new. Thanks for
the help.
On Tuesday, 24 September 2013 11:16:52 UTC+1, Michael Hall wrote:
>
> I am not the most awesome SQL person and as such I am having trouble
> constructing a query I need.
>
> I have two tables in a database called
Hahah... I hope that was not meant as a perjorative!! But no... more like a
postgresql novice myself..
Anyway, it's hard to see how the two query plans are equivalent... don't
have time to work though the example but would be interested to see the
comparison if someone tries it.
On Wednesday,
Il giorno mercoledì 25 settembre 2013 08:46:15 UTC+2, onetwomany ha scritto:
>
>
>
> you can do that with
>>
>> all_courses = db(db.courses.id>0)._select(db.courses.memberid)
>> all_members_not_in_courses = db(~db.members.id.belongs(all_courses))
>>
>>
>>>
> Would such an approach be computationa
you can do that with
>
> all_courses = db(db.courses.id>0)._select(db.courses.memberid)
> all_members_not_in_courses = db(~db.members.id.belongs(all_courses))
>
>
>>
Would such an approach be computationally expensive particularly if the
number of rows in courses is high? Perhaps the following r
it's explained pretty well on the book
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs
let me know if something is not clear
Il giorno mercoledì 25 settembre 2013 07:11:27 UTC+2, step ha scritto:
>
> Niphlod, can you please explain why you're using method _se
Niphlod, can you please explain why you're using method _select instead of
select in your code below? In there no need to connect to SQL to set
all_courses?
On Tuesday, September 24, 2013 3:35:34 PM UTC+2, Niphlod wrote:
>
> you can do that with
>
> all_courses = db(db.courses.id>0)._select(db.c
you can do that with
all_courses = db(db.courses.id>0)._select(db.courses.memberid)
all_members_not_in_courses = db(~db.members.id.belongs(all_courses))
you can eventually throw in a distinct on db.courses.memberid if the number
of courses rows is plenty.
Il giorno martedì 24 settembre 2013 12:
8 matches
Mail list logo