您能在MySQL查询中拆分/爆炸一个字段吗?
CREATE TABLE `clients` ( `clientId` int(10) unsigned NOT NULL auto_increment, `clientName` varchar(100) NOT NULL default '', `courseNames` varchar(255) NOT NULL default '')
courseNames
CREATE TABLE `clientenrols` ( `clientEnrolId` int(10) unsigned NOT NULL auto_increment, `studentId` int(10) unsigned NOT NULL default '0', `courseId` tinyint(3) unsigned NOT NULL default '0')
courseId
courseNames
courseId
2
SELECT e.`studentId`, SPLIT(",", c.`courseNames`)[e.`courseId`]FROM ...
眼眸繁星
慕尼黑8549860
相关分类