在这个查询中,除了 5 个连接表之外,我正在尝试使用第 6 个表“Days”将值与连接中的三个表进行比较。但它给了我错误,我不能在连接中使用子查询。
select
a.ID, a.Name, a.AMT, b.Address, c.Date, c.Pay, d.Check
from
Table1 a
left outer join Table2 b on a.ID = b.ID
left outer join Table3 c on a.ID = c.ID and c.Date= (select Derived_date from Days where TODAY_DATE = TO_DATE(SYSDATE, 'YYYY/MM/DD'))
left outer join Table4 d on a.ID = d.ID and d.Date= (select Derived_date from Days where TODAY_DATE = TO_DATE(SYSDATE, 'YYYY/MM/DD'))
left outer join Table5 e on a.ID = e.ID and e.Date= (select Derived_date from Days where TODAY_DATE = TO_DATE(SYSDATE, 'YYYY/MM/DD'))