0

下面是我要执行的子查询,但是 VC# 2010 在我执行它时会生成异常。

询问:

("SELECT U.Name 
  FROM Users U,Installments I 
  WHERE U.ID=I.ID 
  AND I.Sr=(SELECT MAX(Sr) FROM Installments Group By ID ) 
  AND I.Date=(SELECT Date FROM Installments GROUP BY ID HAVING(Sr=Max(Sr)))"
 , Con))

例外:

解析查询时出错 [Token line number=1,Token line offset=69 Token in error =SELECT ]

4

1 回答 1

0

您的查询不应该是SELECT U.Name FROM Users AS U,Installments AS I WHERE U.ID=I.ID AND I.Sr=(SELECT MAX(Sr) FROM Installments Group By ID ) AND I.Date=(SELECT Date FROM Installments GROUP BY ID HAVING(Sr=Max(Sr)))吗?您没有将表指定为 U 和 I,只是将字母放在表名之后。

于 2012-08-16T13:51:23.213 回答