Usage Notes - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

For positional n-gram matching, the position as well as the pattern must match when measuring similarity. The position value indicates how far away positionally the match may be between the 2 strings as follows:

  • If position is set to a value of zero, the match must be at the same position in the 2 strings.
  • If position is set to a value of x , the match must be within x positions in the 2 strings. For example, if position = 2, then the match must be within 2 positions in the 2 strings.

As an example, for a string of 'abc', the 1-grams (length =1) are 'a', 'b', and 'c'. The 2-grams (length =2) are 'ab' and 'bc'. The 3-gram (length = 3) is 'abc'. By definition, there are no 4-grams or greater.

The function returns zero in the following cases:

  • If the length argument is greater than the length of either string1 or string2.
  • If the length argument is <= 0 or if either string1 or string2 is an empty string.

Patterns beyond the length of 255 are ignored.