Skip to content

Instantly share code, notes, and snippets.

@nnarhinen
Created September 30, 2010 10:14
Show Gist options
  • Save nnarhinen/604348 to your computer and use it in GitHub Desktop.
Save nnarhinen/604348 to your computer and use it in GitHub Desktop.
ServiceQuery::create()
->join('ServiceWeb', 'INNER JOIN')
->join('ServiceWeb.ServiceWebDomain', 'LEFT JOINT')
->join('ServiceWeb.ServiceWebHosting', 'LEFT JOIN')
->withColumn('COUNT(DISTINCT(ServiceWeb.ID))', 'accounts')
->withColumn('COUNT(DISTINCT(ServiceWebDomain.ID))', 'domains')
->withColumn('COUNT(DISTINCT(ServiceWebHosting.ID)), 'hosting')
->select(array('accounts', 'domains', 'hosting'))
->find();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment