'Control the order of adjacent columns when selecting SUM

When you select by a SUM, the returned data is grouped to a single record, which is fine. The query below correctly returns the sum, but the adjacent column values always seem to be from the earliest record. Is there any way to control the order of adjacent columns? For example, return sum and also return data for the newest row instead.

SELECT user_id, sale_date, SUM(totals) as total_sum WHERE user_id = 1

The following does not seem to have an effect. I'm guessing because order is already determined and only 1 row is returned.

SELECT user_id, sale_date, SUM(totals) as total_sum WHERE user_id = 1 ORDER BY sale_date DESC


Solution 1:[1]

You are right you get only one row, but you can always do it this way

Which also looks cleaner

SELECT user_id, MAX(sale_date) as LAST_Sales_date, SUM(totals) as total_sum 
FROM table1 WHERE user_id = 1 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nbk