Hello, I'm trying to make this simple query
SELECT a.*, s.* FROM account a, statement s WHERE a.nb = '2110' AND (a.id = s.debit OR a.id = s.credit) with query, set, rows objects the tables are defined as follow: ..... db.define_table('account', Field('id','id', represent=lambda id:SPAN(id,' ',A('view',_href=URL('read',args=id)))), Field('nb', 'integer', required=True, unique=True), Field('typ', 'string'), Field('name', 'string', required=True, unique=True), format='%(nb)s %(typ)s %(name)s' ) db.account.typ.requires=IS_IN_SET(('Actif', 'Passif', 'Charge', 'Recette')) db.define_table('statement', Field('id','id', represent=lambda id:SPAN(id,' ',A('view',_href=URL('read',args=id)))), Field('date', 'date', required=True, notnull=True), Field('debit', type='reference account'), Field('credit', type='reference account'), Field('amount', 'double', required=True, notnull=True), Field('desc', 'string', required=True, notnull=True) ) ..... Best regards