MySQL GROUP BY id, then show name
If you don't want to use a subquery, you can include the second table with a join before the group by:
SQL Fiddle

SELECT max(name) name, SUM(amount) total
FROM purchases
INNER JOIN users on users.id = purchases.user_id
GROUP BY user_id
ORDER BY user_id


yielding

name    total
Joe       600
Joey      700
Joe       100