Note that SQLObject does not return lists or tuples, it returns SQLResult objects,
which are iterators and can be turned into a sequence with the list() or tuple()
functions. For attributes declared with MultipleJoin or RelatedJoin it returns lists
directly, unless you use SQLMultipleJoin/SQLRelatedJoin.

You can restrict a query using a where condition like this:

A.select(WHERE(A.q.members==10))

If the WHERE is left out, it will be silently assumed, so this would work as well:

A.select(A.q.members==10)

This returns an iterator for all result objects that fit the where condition.
If you want to order the results by creation, you can do it like this:

A.select(A.q.members==10,orderBy=A.q.created)

Note that the result will come sorted from older to newer. If you want it sorted
from newer to older, do this:

temp=A.select(A.q.members==10,orderBy=-A.q.created)

And for a limited result, the recommended way is this:

temp=A.select(A.q.members==10,orderBy=-A.q.created)[:10]

If you pay attention, you’ll see that the slice is done to the query result.
It happens because the slicing operator is overwritten and will work just like
a limit statement in your query.

If you want to retrieve a single result object through its ID, just do this: