sorry for the ambiguos subject, but not sure what terms to use!

I have four (relevant) tables:

category
partner(pid,pname,etc)
service(sid,sname,cid)
sid2pid(sid,pid)


This works fine, listing all services available within a category:

SELECT service.sid,service.sname
FROM service 
WHERE cid='3' 
ORDER BY service.sname ASC

eg:
Adventure 
Group 
Guided Tours 
Singles 
Skiing 
Under 35's 

But I want to get a count of how many times service.sid is found in the
table pid2sid as well...

eg:
Adventure (0)
Group (4)
Guided Tours (2)
Singles (45)
Skiing (0)
Under 35's (12)


I know I need to include a count(), and select from both service and
pid2sid, but other than that, I'm lost :)

TIA
Justin

query,sql


---------------------------------------------------------------------
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

Reply via email to