mysql 字串號以逗號分隔,分隔後第個字符加單引號,而後再拼接起來,字符間用逗號

select channel from tb_user where id='1';
獲得如下結果
+-----------+
| channel   |
+-----------+
| 4,5,6,7,8 |
+-----------+
我想要個結果是
+-----------+
| channel   |
+-----------+
| '4','5','6','7','8' |
+-----------+
select replace(concat('''',channel,''''),',',''',''') from tb_user where id='1';這樣麼

追問:select

結果是
| replace(concat('''',channel,''''),',',''',''') |
+------------------------------------------------+
| '4','5','6','7','8'
我只要| '4','5','6','7','8' | 這一行channel

相關文章
相關標籤/搜索