Possibly just an OUTER JOIN in the first query?

SELECT workshop, COUNT (users.user_ID) AS ct
FROM workshops LEFT OUTER JOIN users ON workshops.agencyid = users.user_id
GROUP BY workshop_id

I think you may be able to put a WITH ROLLUP in there as well, but my SQL 
book has walked off.....

mcg




"Chris C. Cooper" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
01/23/2007 03:50 PM
Please respond to
discussion@acfug.org


To
discussion@acfug.org
cc

Subject
[ACFUG Discuss] Join in QofQ






I?ve got 2 tables
 
Workshops
users
 
I?m trying to do a count of how many users have signed up for each 
workshops. I did 2 SQLl statements then I?m trying to put them together 
with a Query of a Query. I can?t seem to do a join in the QofQ so I how do 
I list all the workshops when no users have signed up for a particular 
workshop?
 
 
 
Select *
FROM workshops,users
where workshops.agencyid = users.user_id
 
SELECT count(*) as total, workshop_id  from users GROUP by `workshop_id`
 
 
select *
from getWorkshops,getworkshoptotals
 
WHERE getworkshops.workshop_id = getWorkshoptotals.workshop_id
 
 
Any ideas how I can do this?
 
 
 

-------------------------------------
Chris C. Cooper
Cooper e.Business Solutions
Atlanta, Georgia 
404.691.4816
 
Cooper e.business Solutions ? http://www.cooperebusiness.com
 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Mason
Sent: Monday, January 22, 2007 4:34 PM
To: discussion@acfug.org
Subject: [ACFUG Discuss] SHA-1 cracked
 
These things are always going to happen (just give it enought time), but a 
research team in China finally cracked SHA-1. 
 
http://it.slashdot.org/article.pl?sid=07/01/20/1936257&from=rss
 
John
[EMAIL PROTECTED]
 
 

------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform 

For more info, see http://www.acfug.org/mailinglists 
Archive @ http://www.mail-archive.com/discussion%40acfug.org/ 
List hosted by FusionLink 
------------------------------------------------------------- 
------------------------------------------------------------- 
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform 

For more info, see http://www.acfug.org/mailinglists 
Archive @ http://www.mail-archive.com/discussion%40acfug.org/ 
List hosted by FusionLink 
------------------------------------------------------------- 

Attachment: jpg8cPrASjS3S.jpg
Description: JPEG image

Reply via email to