空心我对我的桌子有一种查询select m.voterID, sum(jm.mark) from marks m
left join marks jm on jm.id = m.id
where jm.voterID in (1,2)
group by m.voterID
而且我不明白如何使用 CDbCriteria 来编写它。表结构是
`id` int(11) NOT NULL AUTO_INCREMENT,
`voterId` int(11) NOT NULL,
`votedId` int(11) NOT NULL,
`mark` int(11) NOT NULL,
`creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)