Re: SQL Join query
| From: | Curt Zirzow | Date: | Mon, 09 Aug 2004 18:12:42 +0000 |
| Subject: | Re: SQL Join query | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193215@lists.php.net to get a copy of this message | ||
* Thus wrote Jonathan Haddad:
> The only problem there is when you group the LEFT JOIN pictures that
> have a count of 0 return a count of 1. Unfortunately there's no single
> query that I figured out when I did this same project that would give
> accurate results.
SELECT
pics.*,
pic_comments.*,
count(*) + if(pic_comments.pic_id = NULL, -1, 0)
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!