Q&A for Ubuntu users and developers
SELECT VOTETYPES.ID, VOTETYPES.NAME, COUNT(VOTES.VOTETYPEID) AS NUMOFVOTES FROM VOTES LEFT JOIN VOTETYPES ON VOTES.VOTETYPEID = VOTETYPES.ID GROUP BY VOTETYPES.ID, NAME ORDER BY VOTETYPES.ID