Since you use 0 and 1, SUM() should do the trick shouldn't it? Or am I misinterpreting your question?
mysql> create table hotel ( brekky tinyint, confer tinyint ); Query OK, 0 rows affected (0.30 sec) mysql> insert into hotel ( brekky, confer ) values (0,1), (1,1), (0,0), (0,1), (0,1) ; Query OK, 5 rows affected (0.09 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> select sum(brekky), sum(confer) from hotel ; +-------------+-------------+ | sum(brekky) | sum(confer) | +-------------+-------------+ | 1 | 4 | +-------------+-------------+ 1 row in set (0.13 sec) On Fri, Feb 13, 2009 at 9:23 PM, renjith das <[email protected]> wrote: > Hi > Do you have any relation between these two tables? . I mean have > you any field in both table to relate each other. > > If yes you can use the left join to join these two tables. > > Regards > Renjith > > > On Fri, Feb 13, 2009 at 5:12 PM, Olivia Brown <[email protected]> wrote: > >> 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] -~----------~----~----~----~------~----~------~--~---
