|
Posted by J.O. Aho on 10/14/61 11:36
Geradeaus wrote:
> Hello,
>
> I have a problem with the following, first let me explain the database situation :
>
> SELECT region.regionName, COUNT( addate.regionId ) AS Total
> FROM region
> LEFT JOIN addate ON (addate.regionId = region.regionId AND addate.level = 1)
> JOIN ad ON (addate.adId = ad.adId AND ad.adTypeId = 4)
> GROUP BY addate.regionId
SELECT region.regionName, COUNT( addate.regionId ) AS Total FROM region LEFT
JOIN addate ON (addate.regionId = region.regionId) JOIN ad ON (addate.adId =
ad.adId) WHERE ad.adTypeId = 4 GROUP BY addate.regionId
You can't have "OPTIONS" in your joins, those you have to place in your WHERE.
http://dev.mysql.com/doc/refman/5.0/en/join.html
//Aho
Navigation:
[Reply to this message]
|