I have the following query that works fine when providing me with the average rent for the entire metro area:
However I would like the query to return more detailed information from my table.
The rentals I have in my 'listing' table include the following variations for the 'bedrooms' field:
bedrooms1="1"
bedrooms2="2"
bedrooms3="3"
bedrooms4="4"
bedrooms6="Studio"
What I would like the query to return average rental prices for each of the bedroom types.
How do I write the query this way?
Thanks!
Dave
Code:
<!--- 135 is Denver --->
<cfset cs = 135>
<cfquery name="avgRentpermonth" datasource="#DSN#">
SELECT AVG(rentpermonth) as rentavg
FROM listing
WHERE metroFk = <cfqueryparam value='#cs#' cfsqltype='CF_SQL_INTEGER'>
</cfquery>
However I would like the query to return more detailed information from my table.
The rentals I have in my 'listing' table include the following variations for the 'bedrooms' field:
bedrooms1="1"
bedrooms2="2"
bedrooms3="3"
bedrooms4="4"
bedrooms6="Studio"
What I would like the query to return average rental prices for each of the bedroom types.
How do I write the query this way?
Thanks!
Dave