[Question] Divide by Zero

Question: Inspect the attached platform_summary table (screenshot below for reference). Our goal is to list each platform, along with our KPI "percent_active_users." We get this KPI by dividing active_users by total_users. However, the Android platform has 0 users, and will throw a divide by zero error in SQL. How can we perform this division without throwing the divide by zero error?


Desired Output:


Ready for the solution? Click here!

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 1 yr agoLast active
  • 362Views
  • 1 Following