1.从开始截取到第一个括号处的字符串
WITH temp AS (
SELECT '体育西路(558路)' AS route_name
)
SELECT SUBSTR(r.route_name, 0, LOCATE('(' , r.route_name)-1) AS line_name FROM temp r
参考:LOCATE函数简介
1.从开始截取到第一个括号处的字符串
WITH temp AS (
SELECT '体育西路(558路)' AS route_name
)
SELECT SUBSTR(r.route_name, 0, LOCATE('(' , r.route_name)-1) AS line_name FROM temp r
参考:LOCATE函数简介