Bagilah dengan kesalahan nol di SQL
SELECT club_id,
males,
females,
males/NULLIF(females, 0) AS ratio
FROM school_clubs;
Kwams
SELECT club_id,
males,
females,
males/NULLIF(females, 0) AS ratio
FROM school_clubs;
#Replace the result of divide by zero with 0
SELECT COALESCE(dividend / NULLIF(divisor,0), 0)
FROM sometable