Producing RR Lyrae period histogram. SELECT floor(p1 * 50) / 50 AS period, count(*) AS n FROM gaiadr1.rrlyrae GROUP BY period ORDER BY period Produces histogram of periods of RR Lyrae stars . The bins are 0.02 wide in period