|
本帖最后由 〇〇 于 2013-9-12 06:49 编辑
newkid 发表于 2013-9-11 22:47 ![]()
#8 Unique Codes
Using each of the digits from 0 to 9 once, you are going to make codes of 10 digi ...
感觉可以用tranlate判断2个数字是否有数字重合
SQL> with t as(select 'abcd|||||||'a from dual)
2 ,t1 as (select substr(substr(a,-level+1)||a,1,10)b from t connect by level<=7)
3 select count(*) from t1 where instr(translate('1234567890','5671234890',b),'abcd')>0;
COUNT(*)
1
已用时间: 00: 00: 00.00
SQL> with t as(select 'abcd||||||'a from dual)
2 ,t1 as (select substr(substr(a,-level+1)||a,1,10)b from t connect by level<=7)
3 select count(*) from t1 where instr(translate('1234567890','5671248903',b),'abcd')>0;
COUNT(*)
0
|
|