今天用Access数据库写语句,结果出了一堆错误
1.别名不用加引号
2.多表连接时表要用别名,否则提示确实操作符。
SELECT x.mycount, Documents_Info.Doc_Name, x.Cell_Row,
Element_Type_1.Ele_Type_Name
FROM (((SELECT COUNT(Cells.Ele_Type_ID) AS mycount, Cells.Doc_ID, Cells.Cell_Row,
Cells.Ele_Type_ID
FROM (Cells INNER JOIN
Element_Type ON Element_Type.Ele_Type_ID = Cells.Ele_Type_ID)
WHERE (Element_Type.Ele_Type_Group = '审计调整') AND
(Cells.Ele_Type_ID <> '')
GROUP BY Cells.Doc_ID, Cells.Cell_Row, Cells.Ele_Type_ID
HAVING COUNT(Cells.Ele_Type_ID)>1
) x LEFT OUTER JOIN
Documents_Info ON Documents_Info.Doc_ID = x.Doc_ID) LEFT OUTER JOIN
Element_Type Element_Type_1 ON Element_Type_1.Ele_Type_ID = x.Ele_Type_ID)