I was creating an SQL query but ran into some problems with aggregate function or the group by clause. I\'ve never use stack overflow before so please forgive my poor format