You can use COALESCE to convert NULL values to 0 and then take the average to get your AVEALL value:

SELECT AVG(COMM) AVG_COMM, AVG(COALESCE(COMM, 0)) AVEALL
FROM STAFF

Demo on dbfiddle

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top