我的字段有值类型store878。我想从select语句中获得878。如何从select语句中获取该数字
select
store,
address
from
detail,
store_number
where
store (here i would like to have number) = store_mumber.id
答案 0 :(得分:1)
我还没有对此进行测试以确保有效:
SELECT store, address
FROM detail d
INNER JOIN store_number s
ON CAST(SUBSTRING(d.store, LOCATE('%[0-9]%', d.store)) AS int) = s.id
但您应该考虑更改数据库的结构。