> *db(*
> * db.tag.id==db.page_tag.tag_id, # do the JOIN*
> * db.page_tag.page_id==page.id # do the WHERE*
> *).select()*
>
Where did you see that syntax for a multi-condition query? For queries with
multiple conditions, you either use & or chain calls to the Set objects:
db((query1) & (query2) & (query3)).select()
or
db(query1)(query2)(query3).select()
If you want to view the SQL generated by a select, call ._select() instead
of .select() -- that will return a string with the SQL rather than actually
executing the query (there's also ._update(), ._insert(), ._delete(), and
._count()). Another option is to include {{=response.toolbar()}} in the
view, which includes a button to show all the queries done during the
request (and how long they took). You can also access this information
directly via db._timings at any time. Finally, db._lastsql can be used to
view the most recently executed SQL command.
Anthony
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.