Ver originalSELECT *, AVG(nota) notaFROM tabla1 WHERE (nota <>0 OR nota <> '') AND nota IS NOT NULLGROUP BY especialidad;