COUNT(id) AS xtype queries when you wanted to get aggregate values, right?
authorstable, simply do this:
profilesand also setup a
belongsToassociation between the
countriestable as well?
hasManyassociation, CFWheels will be smart enough to add the
DISTINCTkeyword to the SQL. This makes sure that you're only counting unique rows.
idis the primary key of the
authorstable and the correct associations have been setup):
distinct=trueto this function if you want to include only each unique instance of a value in the average calculation.
property, where, include, and
groupargument. Let's build on the example with getting the average salary for a department above, but this time, let's get the average for all departments instead.
cfqueryresult set back, as opposed to a single value.