You can do IN
db(db.w1.key.belongs(('key1','key2','key3')).select()
You can do nested selects
db().select(db.w1.key,db(db.w2.parent==db.w1.id)._select
(db.w2.id.count()))
I suspect in your example w1 and w2 are the same table. I am not sure
you can do this. I may need a minor change to the DAL. let me look
into this.
Massimo
On Dec 19, 2:19 am, mmstud <[email protected]> wrote:
> Im using mysql backend and like to do this sort of query, is it
> possible with DAL?
>
> SELECT w1.key, (SELECT COUNT(*) FROM words w2 WHERE w2.parent = w1.id)
> AS childs
> FROM words w1
> WHERE w1.key IN ('key1', 'key2', 'key3')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---