Strings
Note
+
(str + str) does not work for string concatenation. Use CONCAT
instead.
LIKE
LIKE '%%'
Provides string match functionality with support for standard % notation. Case insensitive.
NOT LIKE
NOT LIKE '%%'
Provides string non match functionality with support for standard % notation. Case insensitive.
Supported String Functions
CONCAT
CONCAT(expr,expr,expr...)
Concatenates strings.
JOIN
JOIN(expr,separator)
Joins the field that is an array of strings using the separator string.
TRIM
TRIM(expr,[chars])
Trims the string
LTRIM
LTRIM(expr,[chars])
Left trims the string
RTRIM
RTRIM(expr,[chars])
Right trims the string
SUBSTR
SUBSTR(expr,start,length)
Returns the substring of a string.
SUBSTR_BYTES
SUBSTR_BYTES(expr,start,length)
Returns the substring of a string by bytes.
REPLACE
REPLACE(expr,find,replace)
Replaces the first instance of a search string in an input string with a replacement string.
REPLACE_ALL
REPLACE_ALL(expr,find,replace)
Replaces all instances of a search string in an input string with a replacement string.
STRLEN
STRLEN(expr)
Returns the number of UTF-8 encoded bytes in the specified string.
STRLEN_CP
STRLEN_CP(expr)
Returns the number of UTF-8 code points in the specified string.
SPLIT
SPLIT(expr,delimiter)
Splits the string to an array.
STRPOS
STRPOS(expr,substr)
Finds the first index of the substring within the expression. Returns 0 if not found and 1 based index position as per PostgresQL.
LOCATE
LOCATE(expr,substr)
Finds the first index of the substring within the expression. Returns 0 if not found and 1 based index position as per MySQL.
LEFT
LEFT(expr, length)
Returns the leftmost characters from the expression.
STARTS_WITH
STARTS_WITH(expr, prefix)
Returns true if the expression starts with the specified prefix.
Example STARTS_WITH
usage
WRAP_PARAM
WRAP_PARAM(expr, [forceString])
Wraps a parameter, typically used for handling special characters or ensuring correct interpretation of a string.
Example WRAP_PARAM
usage
In this example, WRAP_PARAM
ensures that the string with quotes is properly handled, and when forceString
is set to true, it forces the number to be treated as a string.