breakfast available
select count(id) from motels where breakfast_available=1

conference facities available
select count(id) from motels where conference_facilities=1

both
select count(id) from motels where conference_facilities=1 and
breakfast_available=1

(assuming you have an 'id' field)

(I understand there is only one table involved here)

2009/2/13 Olivia Brown <[email protected]>

> 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 one 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)
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to