On Wed, Sep 5, 2012 at 9:12 AM, Baruch Burstein <bmburst...@gmail.com>wrote:

>      SELECT id, a, b, ..., mtime
>     FROM tab
>     WHERE rowid IN (
>         SELECT id, min(mtime)
>         FROM tab
>         GROUP BY id
>     )
>     ORDER BY mtime DESC;
>

In the actual application, "tab" is not a real table but is a join:

     http://www.fossil-scm.org/fossil/artifact/5dfd626877f?ln=271-273

So there isn't a ROWID available to select from.


>
> On Wed, Sep 5, 2012 at 4:03 PM, Richard Hipp <d...@sqlite.org> wrote:
>
> >
> >     SELECT id, a, b, ..., min(mtime)
> >     FROM tab
> >     GROUP BY id
> >     ORDER BY min(mtime) DESC;
>
>
>
>
> --
> ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to