How to use db_select and apply a condition for another table's data?
The following query should be self-explanatory.

$query=db_select('table1','t1');
$query-&gt;join('table2','t2','t1.nid = t2.nid');

$query-&gt;condition('t1.uid','1')
      -&gt;condition('t2.uid','3')
      -&gt;fields('t1',array('uid','nid'))
      -&gt;fields('t2',array('date'));