Hi,

Try:
SELECT f.count(*), s.name FROM first f,second s WHERE f.id = s.id GROUP BY
s.name;

Regards,
  Jocelyn

----- Original Message -----
From: "Mark S Lowe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 3:02 AM
Subject: Count(*) using a join?


I need to do a join with a count...but for some reason I canıt figure out
how to do it using MySQL. Iım hoping that this pseudo code can help you give
me an answer:

> select
>
>     f.count(*),
>     s.name
>
> from
>
> first f, second s
>
> where
>
> f.id = s.id


How do I get a sql result like:

Count        Name
---------------------------
12343        Test

Iıve attempting adding the group by function as documented, but MySQL has
some demands I donıt understand.


Thank you in advance!

Mark



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to