我将从一个例子开始:
*Table1*
ID
PhoneNumber1
PhoneNumber2
*Table2*
PhoneNumber
SomeOtherField
SELECT *
FROM Table1 t1
INNER JOIN Table2 t2
ON t2.PhoneNumber = t1.PhoneNumber1
INNER JOIN Table2 t3
ON t3.PhoneNumber = t1.PhoneNumber2
-- here is the question how do I call same column which have same name?
-- I want to do a where clause like below:
WHERE SomeOtherField(from first Table2) = SomeOtherField(from second Table2)
该示例来自以下问题,但我们提出了不同的问题: 两次加入同一张桌子的最佳方法是什么?