标签:
(SELECT p.*,(SELECT CONCAT(m.name,m.id) FROM service_fastfix_category m WHERE m.id=SUBSTR(p.id,1,4)) AS parentcode,(SELECT GROUP_CONCAT(ee.name
)FROM ele_part_category ee WHERE FIND_IN_SET(ee.code,p.m_part_category_ids))AS groupname FROM service_fastfix_category p ORDER BY p.id) a
1、substr()字符串截取功能。
2、concat()连接
SELECT CONCAT(phone,state)AS dd FROM app_user ORDER BY dd
3、FIND_IN_SET(ee.code,p.m_part_category_ids)
找到code在m_part_category_ids的位置
4、group—concat()
SELECT brandid,GROUP_CONCAT(seriesid) AS ss FROM app_user_car GROUP BY brandid
CONCAT substr group_concat find_in_set
标签:
原文地址:http://www.cnblogs.com/baijin05/p/5040244.html