Posted By

Tate on 12/15/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

qubestream


Select Count of Distinct Value


 / Published in: SQL
 

URL: http://answers.google.com/answers/threadview/id/235114.html

  1. SELECT ChurchID, ChurchName, COUNT( * ) AS count
  2. FROM (
  3.  
  4. SELECT churchxref.ChurchID, church.ChurchName
  5. FROM tripapplication
  6. LEFT JOIN tripleg ON tripapplication.triplegid = tripleg.triplegid
  7. LEFT JOIN person ON person.PersonID = tripapplication.personid
  8. LEFT JOIN churchxref ON churchxref.system_user_id = person.PersonID
  9. LEFT JOIN church ON church.ChurchID = churchxref.ChurchID
  10. WHERE tripleg.tripid = 232
  11. ) AS DerivedTableB
  12. GROUP BY ChurchID

Report this snippet  

You need to login to post a comment.