No, it did work.. but my trest data didn't have what I'd described..
Company x only had 4 offices in one city..
so I've added a few fake offices and it filters!
Phew!!!

cheers...
Final Query
=======================

SELECT company.company_id,

   company.company_name,

   company.website,

location.location_name,

   COUNT(location.location_name) AS COUNT_location_name

FROM premises INNER JOIN company ON premises.company_id =
company.company_id

INNER JOIN location ON premises.location_id = location.location_id
WHERE
premises.status = 1

GROUP BY company.company_id, company.company_name, company.website,
location.location_name

ORDER BY company.company_name ASC


====================





On 15/11/06, David Precious <[EMAIL PROTECTED]> wrote:
On Wed, 15 Nov 2006, r937 wrote:

> > Don't you want to GROUP BY the company name reather than the location
> > name?  By definition, grouping by the location name will only return one
> > row per location...
>
> the GROUP BY should include both

Ah, GROUP BY company, location - of course :)



____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
       Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to $subst('List.Name') as: 
$subst('Recip.EmailAddr')
To unsubscribe send a blank email to $subst('Email.UnSub')
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to