Anzichè fare un select * devi esplicitare i nomi dei campi ambigui nella query

quindi

select tabella1.id as id1, tabella2.id as id2 .....