https://discuss.redash.io/t/new-visualization-histogram/2798/6
SELECT floor(my_column / {{ bin_size }}) * {{ bin_size }} AS bins, count(*) FROM my_table GROUP BY bins;