你说的中文数字应该是字符一、二、三……吧?这是字符判断转为数字,可以用DECODE和CASE WHEN 来解决。如:
select decode(table_column,'一',1,'二',2,'三',3,'四',4,'五',5,'六',6,'七',7,'八',8,'九',9,'零',0,'') from (select '六' as table_column from dual) your_table;
select case when table_column = '一' then 1
when table_column = '二' then 2
when table_column = '三' then 3
when table_column = '四' then 4
when table_column = '五' then 5
when table_column = '六' then 6
when table_column = '七' then 7
when table_column = '八' then 8
when table_column = '九' then 9
when table_column = '零' then 0
else null end
from (select '六' as table_column from dual) your_table;
如果你的X字段是字符串"12345"等纯数字可以使用:
select convert(int,X) from 表
有计算可以直接在查询的时候计算如:
select convert(int,X)*convert(int,X)+convert(int,x)-convert(int,X) from 表
从表格中导出的地址栏目中的405和数字405是不一样的,这个如何更改?我一般采用0替代成0,3替代成3,以此类推,一般要代替十次,有些太麻烦。
convert(numeric(18,0),字段)
1911349528