WEB2PY: Displaying data from DB with JOIN but with some condition <p>I am having trouble with some logic.</p> <ol> <li>I have 3 tables: <code>db.service_request</code>, <code>db.technician</code> and <code>db.assigned</code></li> <li>Many <code>Service Request</code> can be assigned to a <code>Technician</code></li> <li>The table <code>db.assigned</code> is where all assigned <code>service_request</code>are saved together with the <code>Technician</code>'s ID</li> <li>Now I want to display all data in <code>service_request</code> EXCEPT for the <code>service_request</code> that was not assigned to the current logged In <code>Technician</code></li> </ol> <p>How someone please tell me how to make this work ?</p> <p>What I have is this, I get all <code>service request</code> that has been <code>assigned</code> to the current logged in <code>Technician</code>, but does not get all the other <code>service request</code> that has not yet been <code>assigned</code>.</p> <pre><code>query=db.service_request.id==db.assigns.sr_id query2=db.assigns.technician==user_id query4=((query)&amp;(query2)) get_assigned=db(query4).select(orderby=~db.service_request.date_time) </code></pre>