Safe Division With NULLIF
Easy
NULL Handling
Return the click-through rate clicks / impressions as a percentage rounded to two decimals for each row, or NULL when impressions is 0. Order by id.
Table schema
Stats(id INT PRIMARY KEY, clicks INT, impressions INT)Sample data
id | clicks | impressions
1 | 10 | 100
2 | 5 | 0
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.