1

我将从一个例子开始:

*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)

该示例来自以下问题,但我们提出了不同的问题: 两次加入同一张桌子的最佳方法是什么?

4

1 回答 1

1
WHERE t2.SomeOtherField = t1.SomeOtherField
于 2013-10-06T16:44:22.363 回答