Can you clarify please what should be included in the aggregate function and its 'group by'?
I very commonly get the error 'field is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.'
I simply do;
SELECT col1, count(col1), col2
from table1
group by col1
having count(col1)>1
You can sometimes "cheat" the system by including such a column in a MAX (usually) or MIN aggregate so that you don't need to include it in the GROUP BY.