I'll try to make it better ;). For example I have the following list:
id | id_reparaties | id_status | created_on 1 | 1 | 1 | 01-01-14 2 | 1 | 3 | 15-01-14 3 | 2 | 1 | 02-01-14 4 | 3 | 1 | 16-01-14 5 | 1 | 5 | 18-01-14 6 | 2 | 2 | 04-01-14 7 | 2 | 3 | 10-01-14 8 | 2 | 4 | 19-01-14 9 | 3 | 4 | 17-01-14 I want to count the number of id_reparaties that have status 4 as the newest. The answer would be 2 then(id_reparaties 2 and 3 both have status 4 as the newest item. id-reparaties 1 has status 5 as the newest.) Op vrijdag 28 februari 2014 21:33:23 UTC+1 schreef Niphlod: > > your request kinda "sound" bad. > > if you want to: > - filter by id_status > - group by id_reperaties > - count lines > > then it's fine. > > "That have the newest item" is the part that doesn't sound right. "The > newest item" is always going to be one and only one, so counting would just > return 1 for every group ^___^ > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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.