In this case, the original order is correct: db.log.on pulls all the records from auth_user, even those that don't match a record in log. The coalesce() method added by Massimo allows the sum to be null and substitutes 0 for it.
- [web2py] using sum with left join Tim Korb
- [web2py] Re: using sum with left join Massimo Di Pierro
- Re: [web2py] Re: using sum with left join Bruno Rocha
- [web2py] Re: using sum with left join Tim Korb
- [web2py] Re: using sum with left join Peter Etchells
- [web2py] Re: using sum with left join Tim Korb
- [web2py] Re: using sum with left join Cliff
- [web2py] Re: using sum with left join Massimo Di Pierro