2016-08-10 11:33 GMT+02:00 Clemens Ladisch <clem...@ladisch.de>: > Cecil Westerhof wrote: > > SELECT idletime, COUNT(*) > > FROM vmstat > > GROUP BY idletime > > > > But because there are about 400.000 records (and counting) it is not the > > most convenient information. Instead of the number of records I would > like > > to have the percentage of the records. Is this possible? > > SELECT idletime, COUNT(*) / (SELECT COUNT(*) FROM vmstat) * 100 ... >
That would only give zeros. What does work is: COUNT(idletime) / (SELECT COUNT(*) / 100.0 FROM vmstat) AS Percentage -- Cecil Westerhof _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users