I have s select statement that returns some rows as follows:

```
a| b| c| d|
1, 2, 5, 1
1, 5, 7, 1
2, 5, 4, 1
2, 5, 2, 2
3, 5, 9, 1

```

and what I need to happen is if col a and col b in subsequent rows match, they represent the same object and c needs to be added for the rows and returned as a single row. it the next row doesn't match it needs to be returned. Im not sure I need column d, it just was generated from a different select. 

The results for the query would look like

```
a| b| c| d
1, 2, 5, 1
1, 5, 7, 1
2, 5, 6, 1  // the combination of rows 3 & 4
3, 5, 9, 1

```

Sorry, I think too much like a programmer. If someone can give me a place to start I would be very appreciative.