我正在尝试通过将表 Customer 与已加入的 BuyVehicle & Vehicle 表连接起来来获得成对的匹配列,该表我已给出别名“t”。如果我在第一行分配了别名,p1.SSN 和我假设 p2.SSN 将如何跟随未知列?
SELECT p1.SSN, p2.SSN FROM Customer AS p1, Customer AS p2
INNER JOIN (SELECT BVSSN, BVVin, Vin FROM CarPurchase INNER JOIN Car ON BVVin = Vin)
AS t ON p1.SSN = BVSSN & p2.SSN = BVSSN
WHERE p1.SSN < p2.SSN AND //matching columns comparisons yet to be added;
错误 1054 (42S22):“on 子句”中的未知列“p1.SSN”