RE: [PHP-DB] Query help
| From: | Matt Williams | Date: | Mon, 19 Nov 2001 08:16:08 +0000 |
| Subject: | RE: [PHP-DB] Query help | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14430@lists.php.net to get a copy of this message | ||
This doesn't work either.
SELECT count(freerooms.room), WEEK(MAX(booking.date),1),
WEEK(MIN(booking.date),1) as total FROM freerooms LEFT JOIN booking
USING(room);
> > All good so far
> > now if I run this
> >
> > SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1)
> FROM freero
> > oms f, booking b;
> > ->+---------------+---------------------+---------------------+
> > | count(f.room) | WEEK(MAX(b.date),1) | WEEK(MIN(b.date),1) |
> > +---------------+---------------------+---------------------+
> > | 24817 | 48 | 40 |
> > +---------------+---------------------+---------------------+
> >
What I have found is
freerooms.room has 83 rows and booking has 299.
The value returned for count(f.room) is these two figures multiplied.???
Why would it do this?
And how can I get it to return the real value only
Regards
M: