Group By
Wed, 06/23/2010 - 10:51
I have something like this
$myRez = Rule::QueryArray(
QQ::All(),
QQ::Clause(
QQ::GroupBy(QQN::Rule()->Id
)
)
);
I belive the result query is something like this
Select field1,field2 from Table1 group by field1
How can I limit the selected fields ? So I have something like
Select field1 from Table1 group by field1

Unfortunately the framework does not currently support this. We have a preliminary patch and some discussion in http://trac.qcu.be/projects/qcubed/ticket/79 but I can't guarantee it's the most efficient approach, or the one we will eventually incorporate.
Danip, see also the last comments in http://trac.qcu.be/projects/qcubed/ticket/270 . There is code there that may help you suppress the automatically added fields, and to add the aggregation fields that you need. I'm currently using that to solve the exact problem you're facing.