This works for sure in sqlite, mysql and oracle:

db().select(db.tablename.fieldname, distinct=True)

and this is correct approach because I can not imagine biz logic when
you want to select distinct values AND their ID's etc. fields. You
normally use select distinct when you need a list of available values
in a field.

On Jun 2, 10:26 am, Horst Herb <my.list.subscripti...@gmail.com>
wrote:
> On Tue, Jun 2, 2009 at 2:03 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > db(....).select(...,distinct=True)
>
> > I think it does what you ask. if you give it a try, please let us
> > know.
>
> I don't think it does - I have the same problem as jcorbett. As soon
> as you include the "id" in the query, "distinct=True" will return all
> rows, because they are distinct by id.
>
> Some SQL dialects (eg in Postgres) however let you specify "select
> distinct on(columns),  other columns ..." or similar which seems quite
> convenient
>
> However, after 
> readinghttp://www.databasejournal.com/features/postgresql/article.php/343782...
> I started thinking about alternatives
>
> Horst
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to