sqlite calculating percentage I would like to select items from a table where their frequency count is less than 5% of the total amount. 

For example, if I had a table of names, I would like to select the names that appeared less than 5% of the total.
A simple GROUP BY would suffice I think: 

SELECT name, 
       1.0 * COUNT(*) / (SELECT COUNT(*) FROM names) AS percentage
FROM names
GROUP BY name
HAVING 1.0 * COUNT(*) / (SELECT COUNT(*) FROM names) &lt; 0.05 ;