mysql没有split函数,这里手动写一个: ),)) BEGIN CREATE TEMPORARY TABLE IF NOT EXISTS temp_split ( col ) ); DELETE FROM temp_split; ) DO ,instr(c1,split1))); ,instr(c1,split1),''); END WHILE; insert temp_split(col) values (c1); END; 调用时也很简单: call sp_split('abcd,dd…
讲mysql函数之前先给大家展示一下利用mysql函数的一个例子: SELECT i.item_id, i.item_name, i.cid, i.last_update_time, u.url, u.image_count, u.local_image_address_list, u.image_urls_list, u.original_class FROM item_base AS i LEFT JOIN item_url AS u ON IF(i.item_id LIKE 'yihaod…
转自:https://blog.csdn.net/pjymyself/article/details/81668157有分隔符的字符串拆分题目要求数据库中 num字段值为: 实现的效果:需要将一行数据变成多行 实现的SQL SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(),) AS num FROM mysql.help_topic WHERE help_topic_id 涉及的知识点一.字符串拆分: SUBSTRING_INDEX(str, delim, cou…