[PHP-DB] Re: Query construction

2001-08-22 Thread Michael Kumar
select count(*), category from posts group by category or select count(*) from posts group by category where category = 'foobar' should do the trick. regards, mike. -- mfG, Michael Kumar (michael.kumar_at_nme.at, m.kumar_at_hushmail.com) PGP: 30FE 3AB9 5077 C554 5D9E B5CC 0B0F CFB2 55D6

[PHP-DB] Re: Query construction

2001-08-22 Thread Michael Kumar
dang, messed up the order of statements, sorry. of course it must read: select count(*) from posts where category = 'foobar' group by category regards, mike. -- mfG, Michael Kumar (michael.kumar_at_nme.at, m.kumar_at_hushmail.com) PGP: 30FE 3AB9 5077 C554 5D9E B5CC 0B0F CFB2 55D6 AA75 .:

[PHP-DB] Re: Query construction

2001-08-21 Thread Steve Brett
select count(distinct(category)) as number_of_posts from posts; should do it. Steve Russ Michell [EMAIL PROTECTED] wrote in message news:SIMEON.10108211219.F@k1c. anglia.ac.uk... Hi there people: I have a MySQL table consisting of category names among other things. I would like to be able