I have researched, but cannot find an answer to this problem. I am joining multiple tables which all use an "id".
The problem is i need to distinguish which id belongs to which table. In mysql it is ofcouse the AS command as such:
tableA.id AS tableAID
How can I incorporate this into a zf2 large query where several tables are using an id.
$select = $sql->select();
$select->from('tableName')
->columns(array('*'))
->join('tableA', 'tableA.id = tableB.id', array('id'))
->join('tableC', 'tableC.id = tableB.id', array('id'))
->where() //sql command continues
What I believe i need is something like this:
->join('tableA', 'tableA.id = tableB.id', array('id as tableAID'))
->join('tableC', 'tableC.id = tableB.id', array('id as tableCID'))
I thought something like this may work but it breaks the code:
->join('tableA', 'tableA.id = tableB.id', array('id => tableAID'))
Thanks!