/ Published in: SQL
URL: http://answers.google.com/answers/threadview/id/235114.html
Expand |
Embed | Plain Text
SELECT ChurchID, ChurchName, COUNT( * ) AS count FROM ( SELECT churchxref.ChurchID, church.ChurchName FROM tripapplication LEFT JOIN tripleg ON tripapplication.triplegid = tripleg.triplegid LEFT JOIN person ON person.PersonID = tripapplication.personid LEFT JOIN churchxref ON churchxref.system_user_id = person.PersonID LEFT JOIN church ON church.ChurchID = churchxref.ChurchID WHERE tripleg.tripid = 232 ) AS DerivedTableB GROUP BY ChurchID
You need to login to post a comment.
