Compute quantiles over non-NULL values (without interpolation, needs a database with window functions).
Useful links