Based on this answer to another question we might create a sequence of all values and unite it with the values that exist, finally select only those values that are of interest for us:
SELECT value, MAX(n) FROM
(
SELECT value, COUNT(*) AS n FROM theTable GROUP BY value
UNION
(
WITH d as (SELECT n FROM (VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) v(n))
SELECT (SELECT MIN(value) FROM theTable) - 1 + ROW_NUMBER() OVER (ORDER BY NULL), 0
FROM d d0, d d1, d d2, d d3, d d4, d d5, d d6, d d7
)
) AS values
GROUP by value
HAVING value <= (SELECT MAX(value) FROM theTable)
ORDER BY value
Comment from another answer:
value goes up to 18 million
So above sequence was adjusted to select up to 100.000.000.
Note, though, that the query will run for a pretty long time.