gpt4 book ai didi

mysql json将字符串替换为整数

转载 作者:行者123 更新时间:2023-11-29 18:06:40 25 4
gpt4 key购买 nike

如何将 JSON 中的所有值从字符串替换为整数?

+-----------------------------------+ 
| video_related |
+-----------------------------------+
| ["8626416", "8457156", "8605962"] |
+-----------------------------------+

Change to:
+-----------------------------------+
| video_related |
+-----------------------------------+
| [8626416, 8457156, 8605962] |
+-----------------------------------+

最佳答案

您可以使用CONVERT:

SELECT stuff
FROM table
WHERE conditions
ORDER BY CONVERT(name_column, SIGNED INTEGER);

关于mysql json将字符串替换为整数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47768047/

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