|
|
SELECT mp.id, m.`type`, m.`code`, CONCAT(m.`name`, IF(mp.`majorDirection` = '', '', CONCAT('(', mp.`majorDirection`, ')'))) `name`, CONCAT(m2.`name`, '>', m1.`name`) `ancestors`
|
|
SELECT mp.id, m.`type`, m.`code`, CONCAT(m.`name`, IF(mp.`majorDirection` = '', '', CONCAT('(', mp.`majorDirection`, ')'))) `name`, CONCAT(m2.`name`, '>', m1.`name`) `ancestors`
|
|
|
LEFT JOIN `sy_major` m1 ON m1.`code` = m.`parent_code` AND m1.`exam_type` = m.`exam_type` AND m1.type = m.type AND m1.level + 1 = m.level
|
|
LEFT JOIN `sy_major` m1 ON m1.`code` = m.`parent_code` AND m1.`exam_type` = m.`exam_type` AND m1.type = m.type AND m1.level + 1 = m.level
|
|
|
LEFT JOIN `sy_major` m2 ON m2.`code` = m1.`parent_code` AND m1.`exam_type` = m.`exam_type` AND m2.type = m1.type AND m2.level + 1 = m1.level
|
|
LEFT JOIN `sy_major` m2 ON m2.`code` = m1.`parent_code` AND m1.`exam_type` = m.`exam_type` AND m2.type = m1.type AND m2.level + 1 = m1.level
|