Saya sarankan selalu menambahkan alias ke tabel dan kolom. Jadi Anda akan yakin data mana yang dipilih.
select
T1.somedata,
T1.somedata1,
T2X.name as XName,
T2Y.name as YName
from T1 as T1
inner join T2 as T2X on T2X.id = T1.X
inner join T2 as T2Y on T2Y.id = T1.Y