Connor and Chris will both be at AI World from October 12 to October 17 , the premier Oracle conference of 2025. If you're in Vegas, please come say Hi or pop into our sessions
Thanks for the question, Amit.
Asked: May 23, 2018 - 7:22 pm UTC
Last updated: May 28, 2018 - 1:35 am UTC
Version: 12.1
Viewed 1000+ times
select * from xmltable('declare function local:reverse($a) { if (string-length($a) != 0) then concat(substring($a,string-length($a),1), local:reverse(substring($a,1,string-length($a)-1))) else () }; (: eof :) declare function local:sum($a) { if (string-length($a) != 0) then xs:integer(substring($a,1,1)) + xs:integer(local:sum(substring($a,2))) else (0) }; (: eof :) declare function local:prod($a) { if (string-length($a) != 0) then xs:integer(substring($a,1,1)) * xs:integer(local:prod(substring($a,2))) else (1) }; (: eof :) for $i in 1 to 10000 where $i - local:reverse(xs:string($i)) = local:sum(xs:string($i)) + local:prod(xs:string($i)) return $i' columns x integer path '.');
Amit Saroha, May 24, 2018 - 11:05 am UTC
New to good database design? Check out Chris Saxon's full fundamentals class.