gpt4 book ai didi

mysql - mysql中replace函数出错

转载 作者:行者123 更新时间:2023-11-29 11:27:20 24 4
gpt4 key购买 nike

例如,我在 mysql 中的替换功能上遇到问题

set @str = "Category, CategoryName, CategoryID";
SELECT REPLACE (@str, "Category", "125");

我只会替换第一个单词“类别”结果如下:

125,125Name, 125ID

如何解决问题

提前谢谢

最佳答案

如果你真的想使用 MySQL REPLACE 函数,我看到的唯一选项是:

set @str = "Category, CategoryName, CategoryID";
SELECT REPLACE (@str, "Category,", "125,");

关于mysql - mysql中replace函数出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37973921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com