I am trying to select a subset of records from my database based on a particular parameter and then display all those results. In addition to displaying the results, I want a summation of a field, but a summation for the field for just that subset of records:
SELECT name, amount, SUM(amount) AS total FROM sillyhistory WHERE type_id = 1 GROUP BY name";
so that SUM(amount) is not supposed to sum the entire field amount, but just the amounts for that particular query .....
thanks.