高分求解:在Access中采用分组及条件混合查询的错误! 100
在如下语句在SQL2000中运行正常,但在Access中总是提示错误!请问错在哪里?SELECTa.*FROMSamp1aWHERE(ID=(SELECTMAX(ID)F...
在如下语句在SQL2000中运行正常,但在Access中总是提示错误!请问错在哪里?
SELECT a.* FROM Samp1 a WHERE (ID = (SELECT MAX(ID) From Samp1 WHERE (Battno = a.Battno))
提示的错误如下:
丢失 ),]或项目 在查询表达式 '(ID=(select MAX(ID)……)'中
用另外一种方式解决了,如下:
SELECT Battno, Max(WorkOrder) AS WorkOrderx, Last(Vol) AS Volx, Last(Cur) AS Curx, Last(Cap) AS Capx, Last(Epower) AS Epowerx, Last(SpeTime) AS SpeTimex From Samp1 GROUP BY Battno ORDER BY Battno;" 但上面的问题还是没搞懂。 展开
SELECT a.* FROM Samp1 a WHERE (ID = (SELECT MAX(ID) From Samp1 WHERE (Battno = a.Battno))
提示的错误如下:
丢失 ),]或项目 在查询表达式 '(ID=(select MAX(ID)……)'中
用另外一种方式解决了,如下:
SELECT Battno, Max(WorkOrder) AS WorkOrderx, Last(Vol) AS Volx, Last(Cur) AS Curx, Last(Cap) AS Capx, Last(Epower) AS Epowerx, Last(SpeTime) AS SpeTimex From Samp1 GROUP BY Battno ORDER BY Battno;" 但上面的问题还是没搞懂。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询