I need to count different values from the same field and have them print out four separate counts. I also need to be able to sort these by Site ID. Here is how my data looks:
X SiteID
---------------- ---------------------
3 35012
3 12345
3 35012
1 35012
1 35012
3 35012
2 35012
2 12345
So for example, I need to be able to count all the three’s, two’s, and one’s WHERE ((Tbl.SiteID)= '35012') and display the count results individually
Example
Report for Site ID “35012”
Value 3 = 3 Records
Value 2 = 1 Record
Value 1 = 2 Records
This is the code we are using that isn’t working :
sql = "SELECT COUNT(DECODE(x,1,1,NULL)) count_of_1, COUNT(DECODE(x,2,1,NULL)) count_of_2, COUNT(DECODE(x,3,1,NULL)) count_of_3 FROM FinLog.AppSta WHERE ((Tbl.SiteID)= '35012')"
PLEASE HELP!!!!
X SiteID
---------------- ---------------------
3 35012
3 12345
3 35012
1 35012
1 35012
3 35012
2 35012
2 12345
So for example, I need to be able to count all the three’s, two’s, and one’s WHERE ((Tbl.SiteID)= '35012') and display the count results individually
Example
Report for Site ID “35012”
Value 3 = 3 Records
Value 2 = 1 Record
Value 1 = 2 Records
This is the code we are using that isn’t working :
sql = "SELECT COUNT(DECODE(x,1,1,NULL)) count_of_1, COUNT(DECODE(x,2,1,NULL)) count_of_2, COUNT(DECODE(x,3,1,NULL)) count_of_3 FROM FinLog.AppSta WHERE ((Tbl.SiteID)= '35012')"
PLEASE HELP!!!!