以下是引用owenlu1981在2014-4-9 20:34:19的发言:
试试这个
StrSQL = "Select A.* from A inner join (Select [dwg_id],Max([rev_id]) as [rev_id] from A Group By [dwg_id]) as B on " & _
"B.[dwg_id] = A.[dwg_id] and B.[rev_id] = A.[rev_id]"
表名是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