Suppose I have a table that has USER_ID and a AMOUNT columns. For each row, there could be a positive or negative amount in the AMOUNT column.
I'm looking for a way to select from this table such that the result has the id, summation of the amount, summation of the amount of just the positive values, summation of amount of just the negative values for each USER_ID. I can do the summation one quite easily, but I'm trying to figure out how to do the last two columns.
I'm still fairly new to SQL. I know some of the basics but I'm stumped on this one. I have a feeling I can't do this with a single SELECT statement. Any help would be great.