我试图从具有相同列的 2 个表中进行选择,但两个表都有一个内部连接 -
select e.ID,
c.FullName,
car.VIN,
car.Registration,
e.Telephone,
e.Mobile,
e.Email,
e.EstimateTotal,
e.LastUpdated,
e.LastUpdateBy from (select id from Estimates UNION ALL select id from PrivateEstimates) e
inner join Customers c on c.ID = e.CustomerID
inner join Cars car on car.ID = e.CarID
where e.Status = 0
问题是,在inner join上找不到e.CustomerID、e.CarID或e.Status?有任何想法吗?