Re: query help - count

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 10 Oct 2008 05:44:50 +0200
Message-ID: <48eecfb0$0$17213$>

"Jake" <> a écrit dans le message de news: Sorry, I need to change how that is set up. Ignore previous post.

it would be more like



and again... There is a one to many relationship between table 1 and table 2.



 I would like to get a count of unique people in table1 for each  appt_date in table2. Keep in mind that each person may have more than
 one appt in a single day.

Here's the twist though, there is a condition on table one. say person_type=2. So, say I only want to get counts of the unique number of people on each day, but they only count when person_type=2.

And, the results should be rows of:
 appt_date, count
 appt_date, count

How would i do that? Thanks.

What about using COUNT on the join?
Actually where is your problem on this query? Is this in "Keep in mind that each person may have more than one appt in a single day"? Just count DISTINCT person_id.

Michel Received on Thu Oct 09 2008 - 22:44:50 CDT

Original text of this message