表格结构
CREATE TABLE `academicyears` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`campusid` int(11) DEFAULT NULL,
`academicyear` text NOT NULL,
`month` tinyint(4) DEFAULT NULL,
`flag` bit(1) DEFAULT b'1',
PRIMARY KEY (`id`)
);
我的查询
SELECT GROUP_CONCAT(ay.`flag`)
FROM academicyears ay
GROUP BY ay.`campusid`
结果
答案 0 :(得分:2)