Question : SQL QUERY

how come the following query only gives me 1 result?  Data is filled in both 1 and 2 and for example, i would like my table to look like the following:
Month Cust
Jan     200
Feb    400
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
SELECT     
CASE WHEN CUST_1>=0 THEN 'Jan'
WHEN CUST_2>=0 THEN 'Feb'
ELSE 0
END AS 'MONTH'
FROM  
      (SELECT     SUM(CASE WHEN acctsumm.Esiid_1 > 0 THEN 1 ELSE 0 END) AS Cust_1, SUM(CASE WHEN acctsumm.Esiid_2 > 0 THEN 1 ELSE 0 END) 
                                              AS Cust_2
from tbl_a)

Answer : SQL QUERY

No, I have asked your the sample data from your table. My assumption is you have multiple records in your table and you are summing into one record. again you want multiple records from that one record. hence I asked you the sample set from your table.

Anyway if the sample set given in # 26009208 is the result you are getting now, then can you confirm Cust_1 is for Jan, Cust_2 is for Feb so on.... do you have values till Cust_12
Random Solutions  
 
programming4us programming4us