नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime 13.3 LTS and above
Returns true if numStr passes the Luhn algorithm check.
The Luhn algorithm is used for example, to validate creditcard numbers.
Syntax
luhn_check(numStr)
Arguments
numStr: An STRING expression composed of digits'0'through'9'.
Returns
A BOOLEAN.
If numStr contains any character that is not a digit the result is false.
If the input's last digit matches the algorithm the result is true
Examples
> SELECT luhn_check('12345');
false
> SELECT luhn_check('12344');
true
> SELECT luhn_check('1234 4');
false