2016-12-01 21:37 GMT+01:00 Igor Tandetnik <i...@tandetnik.org>:
> On 12/1/2016 1:57 PM, Cecil Westerhof wrote:
>>
>> At the moment I have the following code:
>> SELECT totalUsed, COUNT(*) AS Count
>> FROM tips
>> GROUP BY totalUsed
>>
>> This shows the total number of records for every value of totalUsed.
>> Would it be possible to get the total number of records also. (Sum of
>> all the Count's.)
>
>
> SELECT totalUsed, COUNT(*) AS Count FROM tips GROUP BY totalUsed
> union all
> SELECT null, COUNT(*) FROM tips;

Works likes a charm and is significant faster as the solution from
Nomad. But from him I took:
    SELECT 'Total:', COUNT(*) FROM tips

Thanks, both.

-- 
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to