i want to query the opportunities for a using a set of account ids and get the opportunity for each account that has the most recent start_date__c. so im grouping the opportunity query on account and have max date in my field list, but it doesnt want to return the ID of that record. im having trouble moving it to having or some other means, so im not sure how to write this query. what i THINK should work is
SELECT max(start_date__c), id FROM Opportunity WHERE StageName = 'Signed' AND AccountId IN ('001G000001cK7P2') GROUP BY AccountId
but i have to use an aggregate function around id, so mixed results occur