贤冰 2020-01-14
?
SELECT u.u_name, r.r_name, m.m_title FROM user u LEFT JOIN role r ON u.u_role_id = r.r_id JOIN mysql.help_topic h ON h.help_topic_id < (length(r.r_menu_id) - length(REPLACE(r.r_menu_id, ‘,‘, ‘‘)) + 1) LEFT JOIN menu m ON substring_index(substring_index(r.r_menu_id, ‘,‘, h.help_topic_id + 1), ‘,‘,- 1) = m.m_id ORDER BY u.u_id, r.r_id, m.m_id