mysql按逗号拆分字符串
mysql按逗号拆分字符串
·
需求
原字符串是以逗号分隔保存在mysql中,现需要将该字符拆分出来做查询条件。
实现
SELECT substring_index(substring_index(被拆分的字段,',', b.help_topic_id + 1), ',', -1) FROM 表名 t
join mysql.help_topic b ON b.help_topic_id < (LENGTH(被拆分的字段) - LENGTH(REPLACE(被拆分的字段, ',', '')) + 1)
where finance_apply_no = '1111111111111' and event_no = '******'
更多推荐
已为社区贡献1条内容
所有评论(0)