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)=0,0,1)) from person >review left join ad on ad.id=review.id >group by ad.id; this one returns 0 for the sum column no matter what. the id column can't be null, it's defined as varchar(16) not null. does that help? -jsd- (in order to pass the spam check i have to say the magic word: MySQL) --------------------------------------------------------------------- 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