我有如下表解析子欄在SQL
DRIVER_GID DRIVER_REFNUM_QUAL_GID
SDL2/C001.100000 SDL2.486900 CURRENT DISTRICT
SDL2/C001.100000 SDL2.486900 PERMANENT DISTRICT
SDL2/C001.100000000 SDL2.486900 CURRENT DISTRICT
SDL2/C001.100000000 SDL2.486900 PERMANENT DISTRICT
SDL2.600119036 SDL2.436001 CURRENT DISTRICT
SDL2.600119036 SDL2.436001 PERMANENT DISTRICT
我需要提取字符串之後的數值「SDL2。」來自DRIVER_REFNUM_QUAL_GID列。任何人都可以請推薦一個查詢。
見http://www.codeproject.com/Articles/7938/SQL-User-Defined-Function-to-Parse-a-Delimited-Str找到一個可以工作的解決方案。 – 2013-04-22 20:10:34
您正在使用哪些DBMS? – 2013-04-22 20:29:32
是「SDL」之後的數字。總是從6位開始,6個字符寬?如果是這樣,一個簡單的'substr(driver_refnum_qual_gid,6,6)'將提取你想要的字符串。 – 2013-04-22 20:32:08