Group by having count 1. Aggregate functions sql. функция count sql. having count. postgresql having count пример.