In the following query, the answer of 1/2 is always zero while it should be 0.5. Can you please tell me how to convert the two int columns into float/double?
SELECT 1/2, total, sb_ondate, likes
FROM (
SELECT sb_ondate, COUNT(*) AS total,
STRFTIME("%w",sb_ondate) AS weekDay,
COUNT(CASE WHEN sb_reaction = 'like' THEN sb_id END) AS likes
FROM diet
GROUP BY weekDay) AS f;
Thanks.
Castone of the two divisors as areal:Sample interactive Python session: