Tue Apr 05 2022 03:04:51 GMT+0000 (Coordinated Universal Time)
Saved by @Bambibo9799
To exclude entries with “0”, you need to use NULLIF() with function AVG(). SELECT AVG(NULLIF(yourColumnName, 0)) AS anyAliasName FROM yourTableName; mysql> select AVG(nullif(StudentMarks, 0)) AS Exclude0Avg from AverageDemo;
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments