Forum Moderators: open

Message Too Old, No Replies

MySQL multiple counts problem / help needed

         

crosescu

4:06 am on Feb 13, 2009 (gmt 0)

10+ Year Member



Hi,

I have a MySql database that contains a 'motels' table. One of the fields in the table is 'breakfast_available' and this contains an integer (1 for yes, 0 for no)
The other field in this table is 'conference_facilities' which also stores an integer value 1 or 0 like the other field above.

I would like to setup a MySql query that will display this number of motels have breakfast available (breakfast_available = 1) and this number of motels provide conference facilities (conference_facilities = 1)

topr8

10:17 am on Feb 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



SELECT SUM(breakfast_available),SUM(conference_facilities) FROM motels
GROUP BY id

(i assume there is some kind of id field)