this won't return rows with counts of 0...

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis

"Let's Roll"
        - Todd Beamer, Flight 93



-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 1:54 PM
To: CF-Talk
Subject: Re: OT: SQL without Subquery


How about:

SELECT
   l.id,
   l.description,
   l.build_date,
   l.edit_date,
   l.admin_user,
   COUNT(*) AS userCount
FROM
   mailroomLeadList ll,
   customer c,
   mailroomLead l
WHERE
   l.id = ll.id
   AND ll.customerid = c.id
   AND c.mail_list <> 0
GROUP BY
   l.id,
   l.description,
   l.build_date,
   l.edit_date,
   l.admin_user,
ORDER BY
   description DESC

Jochem


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to