0

试图显示过去 30 天内开具发票的客户车辆。我试过这个:

select C.*, V.*
from CAR_OWNERSHIP O
join VEHICLE V on v.VEH_ID = O.VEH_ID
join CUSTOMER C on C.CUS_ID = O.CUS_ID
where exists (select null
              from INVOICE I
              where I.INV_ID = O.INV_ID and
                    I.INV_DATE >= date() - 30);

我收到“FROM 子句中的语法错误”

4

1 回答 1

1

我很快尝试了访问中的查询,我得到了与您相同的错误,但是当我将 JOIN 更改为特定的连接(如 LEFT OUTER JOIN 或 INNER JOIN)时,该错误消失了,但被另一个错误替换了

 Syntax error (missing operator) in query expression in 

我对此进行了研究,发现这篇文章表明使用多个连接时访问需要括号

select *
from (CAR_OWNERSHIP O
left outer join CUSTOMER C on C.CUS_ID = O.Cus_ID)
left outer join VEHICLE V on v.VEH_ID = O.VEH_ID
where exists (select null
          from INVOICE I
          where I.INV_ID = O.INV_ID and
                I.INV_DATE >= date() - 30);

我希望这会有所帮助

于 2012-11-22T05:43:16.637 回答