Results 1 to 4 of 4
Thread: Help with JOIN needed
May 31, 2002, 04:00 #1
Help with JOIN needed
I have a complicated SQL expression problem (at least for me). I will really appreciate if someone take me out of my problem.
Now to the point:
My appliction is about travel agencies, posting offers in some categories. I have 3 tables:
I have `jour_offers`.agencyID related to `jour_agency`.ID
and `jour_offers`.categoryID related to `jour_categories`.ID
My agency wants to see all the `jour_categories` and how many offers it has in every one of them.
This is what I did...
SELECT jour_categories.ID, jour_categories.name, COUNT( jour_offers.ID ) AS COUNT_OF_OFFERS FROM jour_categories LEFT JOIN jour_offers ON (jour_categories.ID = jour_offers.categoryID) GROUP BY jour_categories.ID
If anybody can help me... it will be great! Thanks in advance!
See the databases in the attached .JPG