I have the following query, which is trying to figure out the percentage of a certain product compared to the total number of products. IE: [Product Count] / [Total Products
Cast as something with decimal precision, not Integer. A float or real.
select cast(distinctCount as real)/cast(totalCount as real) * 100.00
, distinctCount
, totalCount
from (
select count(distinct id) as distinctCount
, count(id) as totalCount
from Table) as aggregatedTable