AFAIK there's no standard "first()", but min() can be used as well. The thing is.... the book needs an update and we shouldn't really return anything that is not explicitely included in the column. Having something like
select min(table.field1), min(table.field2), min(table.field3), table.field4 from table groupby table.field4 by default (i.e. apply min() to any field that is not included in the groupby) is 1) a total waste of CPU 2) not a meaningful resultset anyway. On Wednesday, August 7, 2013 1:38:53 PM UTC+2, Simon Carr wrote: > > does gluon have notion of .first() (as in sum(), count(), first())?. If > some change to gluon is going to be made in the future then you could have > gluon assume that table.ALL when used with groupby should refer to the > first value in each group. > > On Wednesday, 7 August 2013 12:20:29 UTC+1, Johann Spies wrote: >> >> Yes, I think the documentation is not correct. It is nonsensical anyhow >> to do a groupby when you select all the fields including the primary key >> id. Groupby groups similar values and if you do select.ALL there cannot be >> two similar records. >> >> Regards >> Johann >> >> >> On 7 August 2013 13:15, Simon Carr <simon...@gmail.com> wrote: >> >>> So the web2py documentation is incorrect then and the db.person.ALL >>> line removed from the example. >>> >>> >>> >>>> -- >>> >>> --- >>> 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+un...@googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> Because experiencing your loyal love is better than life itself, >> my lips will praise you. (Psalm 63:3) >> > -- --- 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.