On Sep 5, 2012, at 3:03 PM, Richard Hipp <[email protected]> wrote:
> SELECT id, a, b, ..., min(mtime)
> FROM tab
> GROUP BY id
> ORDER BY min(mtime) DESC;
Perhaps something along these lines, i.e. a simple self-join:
select foo.*
from foo
join (
select id,
min( mtime ) as mtime
from foo
group by id
)
as MinFoo
on MinFoo.id = foo.id
and MinFoo.mtime = foo.mtime
order by foo.mtime desc
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users