select table_a.id as a_id, table_b.id as b_id, ..