My sample file as below (four columns):
ID Balance1 Balance2 Balance3
xx -1 -1 0
yy -1 0 1
Each customer is unique. I want to count the number of negative values and positive values e.g.count negative for xx is 2 and for yy is 1 while positive value (more than 0) for xx is 0 and yy is 1.
I can use the COUNTIF function in Excel, but how can I use SQL statement?
Id,Balanceand whatever the name is for the data currently being embedded in your column names of 1, 2 and 3.