--後三位 和 前三位 比較
select t.REG_ADDRESS, t.REG_ADDRESS_DETAIL from T_COMMON_001_MAIN t
where t.DATA_FROM=3 and t.REG_ADDRESS like '四川%'
and substr(t.REG_ADDRESS,instr(t.REG_ADDRESS,'市',1,1)+2,LENGTH(t.REG_ADDRESS))=substr(t.REG_ADDRESS_DETAIL,0,3)
;
--中三位 和 前三位
select t.REG_ADDRESS, t.REG_ADDRESS_DETAIL from T_COMMON_001_MAIN t
where t.DATA_FROM=3 and t.REG_ADDRESS like '四川%'
and substr(t.REG_ADDRESS,instr(t.REG_ADDRESS,'省',1,1)+2,3)=substr(t.REG_ADDRESS_DETAIL,0,3)
;
--後兩位 和 前兩位
select t.REG_ADDRESS, t.REG_ADDRESS_DETAIL from T_COMMON_001_MAIN t
where t.DATA_FROM=3 and t.REG_ADDRESS like '四川%'
and substr(t.REG_ADDRESS,length(t.REG_ADDRESS)-1,2)=substr(t.REG_ADDRESS_DETAIL,0,2)
;select