I have a long query which references many fields in different tables. I want to look up the last status for each row of data and this works in smaller queries when I group by all the other fields (excluding the date one).
With a much longer query looking at more fields, I am getting the below errors for all fields:
is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
Is there something obvious I am missing please?
Thanks in advance