<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
<In this course, it often helps to include a screenshot of your whole web browser – that lets everyone see what you see. If you wish to include a screenshot, add it below this line.>
select
date(g1.created_at) as dt,
round(count(distinct g2.user_id) /
count(distinct g1.user_id)*100) as retention
from gameplays as g1
left join gameplays as g2 on
g1.user_id = g2.user_id
and date(g1.created_at) = date(datetime(g2.created_at, ‘-1 day’))
group by 1
order by 1
limit 100;
the correct code should be roung(100count(distinct g2.ueser_id)/count(distinct g1.user_id))
I don’t understand why we should put 100 on the left side of the count(distinct g2.user_id).
If I put it on the right side of the count(distinct g1user_id),like the code I put above,the result will be all 0.
Please help me with this problem.Thank you!
<do not remove the three backticks above>