原帖由 yang_java2004 于 2009-3-25 09:56 发表
有如下数据:
00000
00001
00002
00003
00004
.........
99998
99999
求匹配如下模式的数据:ABABA,AAABB,ABCDE ,其中ABCDE,为0~9的数字
这样的sql怎么写?
原帖由 doni 于 2009-3-25 13:34 发表
mod(
((ascii(substr(field,1,1))-ascii(substr(model,1,1)))*10000) +
((ascii(substr(field,2,1))-ascii(substr(model,2,1)))*1000) +
((ascii(substr(field,3,1))-ascii(substr(model,3,1)))*100) +
((a ...
原帖由 doni 于 2009-3-25 13:34 发表
mod(
((ascii(substr(field,1,1))-ascii(substr(model,1,1)))*10000) +
((ascii(substr(field,2,1))-ascii(substr(model,2,1)))*1000) +
((ascii(substr(field,3,1))-ascii(substr(model,3,1)))*100) +
((a ...
原帖由 dtsjs 于 2009-3-26 11:23 发表
先建立一个模式表 create table hm_mod (hm_mod varchar2(5));
存 AAABB ABABA
再建一个表 create table hm (hm varchar2(5))
存号码
SELECT * FROM hm A ,HM_MOD B WHERE
TRANSLATE(HM_MOD,HM_MOD, ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |