select count(distinct installation_id), SUM(hit_block), AVG(???)
T开发者_如何学Gohis is the select statement. I want to divide the value returned by first field (count(distinct installation_id)
) by the second field. Please suggest me how to do it.
select count(distinct installation_id)/SUM(hit_block),AVG(??)
Basically you can do numerical operations in between what could be separate selectable clauses.
I'm not sure what you want to find the average of?
i dont think i understand very clearly what is it that you want to do, perhaps if you add an example data set, and the a description of the problem you are trying to solve by running that query, if what you want to do is just divide you can apply the arithmetic operands
note that this is just an example and wont probably work as i dont have a way of testing this on your enviroment
SELECT (COUNT(DISTINCT installation_id) / SUM(hit_block))
,AVG(???)
FROM ????
GROUP BY ????
note that you should probably replace the question marks with real values ???, is this what you were looking for? if not please explain i can probably still help
精彩评论