SUBSTRING
SUBSTRING(s, start, length) 從字符串 s 的 start 位置截取長度為 length 的子字符串
從字符串 Hello World 中的第 2 個位置截取 3個 字符:
eg:select SUBSTRING("Hello World",2,3) as test;
注:字符串的索引是從1開始的。
如果第三個參數不傳,是從start位置截取到最后
eg:select SUBSTRING("Hello World",2) as test;
SUBSTRING(str FROM pos FOR len) 與上面結果一樣,從字符串str的pos位置截取長度為len的子字符串