[英]How would I find all records in a number column (Oracle) which have 3 digits in Sequence
How would I find all records in a number column (Oracle) which have 3 digits in Sequence.我如何在序列中有 3 位数字的数字列(Oracle)中找到所有记录。 Would I have to use substr to break down the number to individual digits and then subtract first and second digit to see if they are 1 or -1?
我是否必须使用 substr 将数字分解为单个数字,然后减去第一个和第二个数字以查看它们是 1 还是 -1? Is there a better way to do it?
有更好的方法吗? Could I break down the number into digits and pass them to a varray in a pl/sql block?
我可以将数字分解为数字并将它们传递给 pl/sql 块中的 varray 吗? Please help.
请帮忙。
Assuming that you mean "sequential" as in 1-2-3, then you can use brute force:假设您的意思是 1-2-3 中的“顺序”,那么您可以使用蛮力:
(case when regexp_like(ssn, '012|123|234|345|456|567|678|789')
then 'in sequence' else 'not in sequence'
end)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.