> He explained you don't need a group by in a having statement and that I needed to go back and study sql. I sat there awkwardly [I have been writing sql since I was 14 - I was 25].
SQL isn't the most portable language. Postgres has special behavior for aggregates/having without group by which essentially creates an implicit group by, other engines will raise an error (SQL Server iirc)
Clearly not something to nitpick over in an interview
He's technically right though. For instance in postgres, you don't need to have a GROUP BY clause when using HAVING https://www.postgresql.org/docs/current/sql-select.html#SQL-...