How to deal with duplicate table name with db_select left join Basically I have a db_select that has two left joins.  And will be calling up two table fields with the same name.  The fields have different data though, so I need to be able to have access to both in my results.  In a normal query I’d set this in the SELECT - how can i do the same in db_select 

SELECT table1.column AS column1, table2.column AS column2
FROM table1
LEFT JOIN table2
ON table1.column = table2.column


here's my code that i need to change

$query-&gt;leftjoin('migrate_map_emp', 'm', 'm.sourceid1 = i.ID');
$query-&gt;leftjoin('migrate_map_emplogo', 'ml', 'ml.sourceid1 = i.ID');

$query-&gt;fields('i', array('ID','Name'))
      -&gt;fields('m', array('destid1'))
      -&gt;fields('ml', array('destid1'));


[solved]

the above code works.  I did a 'drush_print_r'  on the rows returned at the second item is labelled ml_

[destid1] => 5
    [ml_destid1] => 2

Many thanks
You can fetch data with drupal db_select as below code:-

$query= db_select('table1', 'column1');
$query-&gt;join('table2', 'column2', 'column1.column=column2.column'); 

$query=$query-&gt;fields('column1',array('column'))
       -&gt;fields('column2',array('column'))       
       -&gt;execute()-&gt;fetchAll();


For more information on db_select join queries click on this link