SELECT Job_Id, MAX(Monitor_Date) Monitor_Date FROM source_table GROUP BY Job_Id


This can be solved by aggregating first and joining to the result of the aggregation: SELECT c.name as campaign_name, o.name as organization_name d.total_amount FROM ( select "campaignId", sum(amount) as total_amount from donations group by "campaignId" ) d JOIN campaigns c ON c.id = d."campaignId" ...


Unless I have misunderstood, the desired output is the username, game, total number of items bought, and total price paid for the items. This can be obtained by counting the items and summing the price, like so: SELECT u.[Username] , g.[Name] , COUNT(i.[Name]) AS [Items Count] , SUM(i.Price) AS [Items Price] FROM UsersGames ...

Only top voted, non community-wiki answers of a minimum length are eligible