i am constructing a fairly complicated query on a table that has a field called 'type'. this field has possible values 's','r','c'. what i would like to do is to sum all entries in the table grouped by an id number and then by whether the type is s or not.
i.e. i want results like this:
ID -- type -- sum
1 -- s -- 57
1 -- r+c -- 13
2 --- r+c -- 7
3 -- s -- 5
etc.
can anyone point me in the right direction?