W
wanwqing
Unregistered / Unconfirmed
GUEST, unregistred user!
执行如下语句会出错,提示" ) 附近有错误 ",请问如何解决!<br> SQLStr:='SELECT * from (';<br> SQLStr:=SQLStr+'SELECT month(B.dDate) as 月份,0 as 入库金额,sum(A.fPrice*A.fQuantity) as 出库金额 FROM 出货单明细表 as A,出货单表 AS B where (A.iNo=B.iNo) and (year(B.dDate)=:X) group by month(B.dDate)';<br> SQLStr:=SQLStr+'union SELECT month(B.dDate) as 月份,sum(A.fPrice*A.fQuantity) as 入库金额,0 as 出库金额 FROM 进货单明细表 as A,进货单表 AS B where (A.iNo=B.iNo) and (year(B.dDate)=:X) group by month(B.dDate)';<br> SQLStr:=SQLStr+')'; //   附近有语法错误<br> Query1.SQL.Add(SQLStr);<br> Query1.Params[0].Value:=Edit1.Text;<br> Query1.Open;<br>为了简化问题,在SQL查询分析器中执行如下语句会出错,请问如何解决!<br>use store<br>select * from (select * from 出货单明细表)