Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Montana USA

    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

  2. #2
    Join Date
    Jul 2001
    Toronto, ON.
    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";


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts