我的查询给了我以下错误信息:
15:36:08 [SELECT - 0 row(s), 0.000 secs] [Error Code: 102, SQL State: 37000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'c'.
询问:
SELECT ftgnamn, ordernr, bestdat, q_text, oac, bcu, reminv, oldfak, reminv+oldfak
FROM
(
(SELECT fr.ftgnamn, q_order.q_ordernr 'ordernr', q_order.kundbestdat 'bestdat', q_order.q_text, q_order.q_orderpos,
q_order.vbordsum 'oac', q_order.ordsum 'bcu', (q_order.vbordsum - q_order.vb_faktsum) 'reminv'
FROM fr, q_order, ac
WHERE fr.ftgnr=q_order.ftgnr AND q_order.vbordsum - q_order.vb_faktsum > 0
) a LEFT JOIN
(
SELECT SUM(belaconto) 'oldfak', q_ordernr, q_orderpos
FROM ac
WHERE CAST('2000-05-31' AS DATETIME) <= ac.faktdat AND ac.faktdat IS NOT NULL
GROUP BY q_ordernr, q_orderpos
) b ON (a.q_ordernr=b.q_ordernr AND a.q_orderpos=b.q_orderpos)
) c
谁能看到出了什么问题?