There are four ways to accomplish this (after establishing the needed criteria to group the constituents):

If individual gifts are not needed:
  
In the query’s output, include Summary Information > Total Amount of Gift.

OR

Use the query in a Constituent Export, and output Summary Information > Gifts > Total Gift Amount
 
If individual gifts are needed:
 
Include the query in a Constituent Giving History Report to output the itemized list of gifts that are sub-totaled by constituent as well as by grand total at the end of the report.

OR

From the query, click File and Export. Use the Sum functions in Excel to add the individual gifts.