OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

COUNT Function

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> COUNT Function
Page: [1]
 
hzarabet

 

Posts: 1549
From: New Milford CT USA
Status: offline

 
COUNT Function - 6/2/2009 22:53:12   
Hi Spooky and Co! It has been a long time since I have been here. I hope all have been well and at least somewhat prosperous the last couple of years!!!

I set up a survey. For each of 12 questions there are 3 possible answers. Additonally, there are 3 subsets of users I want to further analyze these results with. I hope I am wrong, but the only want I know of obtaining the count for each option is to the use the COUNT function. If this is the case I will need to have 12x3x3 (108) COUNT SQL calls on my page!!!!! This will be a private page that is just used by me.

For example, just for Question 1 I would need to following to tally all my results!!!

SQL COUNT(*) FROM MyTable WHERE Question1 = 'Y' And USER = 'P'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'N' And USER = 'P'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'S' And USER = 'P'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'Y' And USER = 'C'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'N' And USER = 'C'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'S' And USER = 'C
SQL COUNT(*) FROM MyTable WHERE Question1 = 'Y' And USER = 'L'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'N' And USER = 'L'
SQL COUNT(*) FROM MyTable WHERE Question1 = 'S' And USER = 'L'


Is there a more efficient way to do this????

Thank you!!


_____________________________

http://www.SigningsHotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> COUNT Function
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts