"Frank Morton" <fmorton(at)base2inc(dot)com> writes:
> I want to do a select which only returns the highest revision
> level for each filename,
Try something like
SELECT filename, max(revision) FROM table GROUP BY filename;
When you use GROUP BY, aggregate functions like max() are applied
separately over each group --- which is just what you want for this
problem.
regards, tom lane