Potentially something like this, if the DBMS supports subqueries in the Select clause:
Code:
select id, sum(amount) , (sum(amount) /  (select sum(amount) from XXXX))*100 from XXXX group by id