Results 1 to 2 of 2
Thread: MySQL query help please?
-
07-24-2002, 11:54 AM #1Web Hosting Master
- Join Date
- Apr 2001
- Location
- Montana USA
- Posts
- 673
MySQL query help please?
I have a customer survey table, in which the basic format is
want_moredisk enum(Y, N)
want_morebandwidth enum(Y, N)
I want to write a query which will tell me that 200 respondents wanted more disk, 156 wanted more bandwidth, and so on down the line (50+ columns of things they may want).
It seems like this should be simple but I am hitting a brick wall.
Also, some of my columns are enum(Y,N), but ask what features they appreciate most:
appr_opensourcefocus enum(Y,N)
appr_htaccesseditor enum(Y,N)
and so on.
Is there a way to filter results by column name? Where columnname like 'appr_%' ?
Really I'm not a MySQL newbie... just blanking out this morning.
Thanks for any help.John Masterson
Former Hosting Company Owner
-
07-24-2002, 09:31 PM #2Web Hosting Guru
- Join Date
- Jul 2001
- Location
- Toronto, ON.
- Posts
- 312
i'm not 100% sure that i know what you mean, but you could try something like:
select count(want_more_disk, want_more_bandwidth) from survey where want_moredisk='Y' && want_morebandwidth='Y";
help?