I  have this Python code:<br />
<br />
<br />
    self.lock_tables("read", ['nets_permissions as n', 'devices_permissions as d'])<br />
    usrs = self.db.get("SELECT n.user_id FROM nets_permissions as n \<br />
                        left join devices_permissions as d \<br />
                        on n.user_id = d.user_id \<br />
                        where d.user_id is null \<br />
                        and n.network_id=%s and n.perm<>3", netid)<br />
    self.unlock_tables()<br />
    <br />
    for usr in usrs:<br />
        self.lock_tables("write", ['devices_permissions'])<br />
        self.db.execute("INSERT devices_permissions SET \<br />
                         user_id=%s, network_id=%s, device_id=%s, perm=%s",\<br />
                         usr, netid, sensid, perm)<br />
        self.unlock_tables();<br />
<br />
I first do a query to retrieve some user_id from two tables. I want save this user_id in one variable and after do a for loop to insert this records in another table...<br />
<br />
<br />
    This code doesn't work. I obtain this error:    <br />
    Exception: Multiple rows returned for Database.get() query<br />
<br />
How can I retrieve this multiple rows and then process everyone of them at one time?<br />
<br />