Hi,
Yes I have made some mistakes. There was problem with the outer
join. It should have been ad outer joined to review, not the other way.
I didn't notice the first tabel person in the query.
Try the following with two tables ad and review and later add person
table. We don't know the column
At 01:43 AM 2/12/2002, you wrote:
>Hi,
>Does this work for you?
>
>select ad.id,adtype,name,sum(review.id is not null) from person
>review left join ad on ad.id=review.id
>group by ad.id;
this one returns 1 for the sum column no mater what.
>select ad.id,adtype,name,sum(if (ifnull(review.id,0)=
Hi,
Does this work for you?
select ad.id,adtype,name,sum(review.id is not null) from person
review left join ad on ad.id=review.id
group by ad.id;
OR
select ad.id,adtype,name,sum(if (ifnull(review.id,0)=0,0,1)) from person
review left join ad on ad.id=review.id
group by ad.id;
Anvar.
At 06:13
i have what is basically a personal ad database.
in one table, i have a list of advertisers. in another table i have a list
of reviews. (there's a third table with stuff like their name, address,
etc). i want to get a list of advertisers and the number of reviews all in
one query. i can do