select a, b from (
select a, a b from xx where lengthb(a)>1 and substrb(a,2,1)>='1' and substrb(a,2,1)<='9' union select a, '0'||a b from xx where lengthb(a)=1 union select a,'0'||a b from xx where lengthb(a)>1 and (substrb(a,2,1)<'1' or substrb(a,2,1)>'9') ) order by b
select a, b from (
select a, '0'||a b from xx where lengthb(a)>1 and substrb(a,2,1)>='1' and substrb(a,2,1)<='9' union select a, '0'||a b from xx where lengthb(a)=1 union select a,a b from xx where lengthb(a)>1 and (substrb(a,2,1)<'1' or substrb(a,2,1)>'9') ) order by b