I have a table similar to the following in my database

```
+----+----+----+---------------------+
| id | a  | b  | date_created        |
+----+----+----+---------------------+
|  1 | 22 | 33 | 2014-07-31 14:38:17 |
|  2 | 11 |  9 | 2014-07-30 14:40:19 |
|  3 |  8 |  4 | 2014-07-29 14:40:34 |
+----+----+----+---------------------+

```

I'm trying to write a query that subtracts `sum(b)` from each `a`. However, the values of `b` included in `sum(b)` should be only those that are earlier than (or the same time as) the `a` they are being subtracted from. In other words, the results returned by the query should be those shown below

```
22 - (33 + 9 + 4)
11 - (9 + 4)
 8 - (4)

```

is it possible to calculate this in a single query?