我有一个由调度程序应用程序创建的表,该表包含ID
形式的WEEK
和["1","2","5","10","20","52"]
两列。
我想提取和标准化ID和WEEK列,以便能够绘制时间轴。不幸的是,我甚至不知道从哪里开始。
答案 0 :(得分:0)
SELECT * FROM ints;
+---+
| i |
+---+
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
+---+
SELECT DISTINCT SUBSTRING_INDEX (SUBSTRING_INDEX('1,2,5,10,20,52',',',i+1),',',-1)+0 x FROM ints;
+----+
| x |
+----+
| 1 |
| 2 |
| 5 |
| 10 |
| 20 |
| 52 |
+----+