How to format a MySQL query that involves divison
I have a MySQL table with a column upvote, and a column downvote, and I only wish to return results that have a specific ratio between the two and the total vote count, say between .4 and .6 I would consi开发者_运维百科der these results to be "controversial" so to speak.
Is it possible to format a MySQL query that involves the divison of two or more rows?
SELECT * FROM TABLE WHERE (cola / colb > 0.4) AND (cola / colb < 0.6);
精彩评论