【发布时间】:2016-12-26 04:35:19
【问题描述】:
我想从字符串中提取数值。
例如。我有这样的价值观:
abc9856412368def
9812345678abc
abc9812345678
abc256789def
4567abc
我想要这样的输出(三列):
Col1 Col2 Col3
abc def 9856412368
abc 9812345678
abc 9812345678
abc def 256789
abc 4567
如果数字是 10 或大于 10,则将其存储到 col2 中,否则存储在 col3 中。我试过使用 REGEXP 但它没有提取 mysql 工作台中的数字。但它返回零行。
select first_name
from mytable
where First_Name regexp '^[0-9]+$' and First_Name!=""
我想用java找到它。将其存储在结果集中。我还想确保将手机号码插入第 2 列。有人可以指导我吗?
【问题讨论】: