Мое последнее и, по моему мнению, наиболее близкое к ответу:
Код: Выделить всё
SELECT DISTINCT profession, COUNT(salaire) as salaire_moyen
FROM personnel
LIMIT 0,5;
Код: Выделить всё
+------------+---------------+
| profession | salaire_moyen |
+------------+---------------+
| infirmier | 17 |
+------------+---------------+
Код: Выделить всё
+---------------+---------------+
| profession | salaire moyen |
+---------------+---------------+
| secretaire | 1300.00 |
| aide soignant | 1400.00 |
| infirmier | 1505.00 |
| psychologue | 1700.00 |
| medecin | 1966.67 |
+---------------+---------------+
Подробнее здесь: https://stackoverflow.com/questions/793 ... s-with-sql