DISTINCT and DISTINCT ON are two differents things : http://www.postgresql.org/docs/9.1/static/sql-select.html#SQL-DISTINCT
I think that this is a issue with differents adaptors... And you maybe right that DISTINCT ON is only available on postgres... Richard On Fri, Mar 8, 2013 at 5:31 AM, Marin Pranjić <marin.pran...@gmail.com>wrote: > A quote from the book: > > > Notice that distinct can also be an expression for example: >> >>> for row in db().select(db.person.name,distinct=db.person.name): >> print row.name >> Alex >> Bob >> Carl >> >> >> >> > While this works on PostgreSQL, others raise an exception. > > OperationalError: near "ON": syntax error > > > This is what I get on SQLite. > It makes sense because 'DISTINCT ON' is only supported by Postgres > (correct me if I'm wrong). > > > Do we need this in the book? > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.