一种有效的方法通常是使用
not exists:
select t.*from table twhere not exists (select 1 from table t2 where t2.file = t.file and t2.Version > t.version );
此查询可以利用上的索引
table(file, version)。
这将查询重新表述为:“从表中获取其中相应文件没有较大版本的所有行。”

一种有效的方法通常是使用
not exists:
select t.*from table twhere not exists (select 1 from table t2 where t2.file = t.file and t2.Version > t.version );
此查询可以利用上的索引
table(file, version)。
这将查询重新表述为:“从表中获取其中相应文件没有较大版本的所有行。”