如何将JSON中的所有值从字符串替换为整数?
+-----------------------------------+
| video_related |
+-----------------------------------+
| ["8626416", "8457156", "8605962"] |
+-----------------------------------+
Change to:
+-----------------------------------+
| video_related |
+-----------------------------------+
| [8626416, 8457156, 8605962] |
+-----------------------------------+
答案 0 :(得分:0)
您可以使用 CONVERT :
SELECT stuff
FROM table
WHERE conditions
ORDER BY CONVERT(name_column, SIGNED INTEGER);
答案 1 :(得分:0)
您也可以使用CAST:
SELECT CAST(col AS SIGNED INTEGER)
FROM table