Link to home
Start Free TrialLog in
Avatar of jlrray
jlrray

asked on

error: you tried to execute a query that does not include the specified expression as part of an aggregate function

I'm having trouble trying to only show the latest date for the query below.

ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Answer given by Peter but just to explain

For each field you select that is not part of the aggregate function (i.e. that wrapped in MAX) then they must have a group by and this is placed after your where clause (if you have one, or after from if you don't) and before any order by you might have

select ...
from ...
where ...
group by ...
order by ...