Group by having count 1. Having sql. разница между where и having sql. where b having sql. sql having with max.