以下是引用alex15在2014-4-10 10:22:02的发言:
表名是revision
Select dwg_id,rev_id,rev_no from revision inner join (Select dwg_id,Max(rev_id) as rev_id from revision Group By dwg_id) as B on B.dwg_id = revision.dwg_id and B.rev_id = revision.rev_id;
报错Ora-00905: missing keyword
你把2楼的例中表名A换成revision
StrSQL = "Select revision.* from revision inner join (Select [dwg_id],Max([rev_id]) as [rev_id] from revision Group By [dwg_id]) as B on " & _
"B.[dwg_id] = revision.[dwg_id] and B.[rev_id] = revision.[rev_id]"