I am using CFWheels and trying to find a way to do subqueries. I want to know what options are available. Currently I am constructing my queries using plain old Coldfusion query and adding a huge string of the query in execution. I want to know if there are more cleaner options available using CFWheels model functionality.
My table is:
I wish to perform this query on the table:
select COUNT(tb1.formid) as number_of_submission, tb1.formid
from ( select formid, room, inspector
from test_tbl
group by formid, room, inspector) tb1
group by tb1.formid;
Which displays the following:
And just to elaborate a bit more, the inner query gives: