Updated on 2026-11-06 GMT+08:00

char_matchcount

The char_matchcount function is used to calculate how many characters in str1 appear in str2.

Syntax

char_matchcount(string , string ) 

Parameters

Parameter

Mandatory

Type

Description

str1, str2

Yes

STRING

The strings to be calculated, str1 and str2.

Return Values

Returns a value of type BIGINT.

If str1 or str2 is NULL, NULL is returned.

Example Code

Returns 3.

select char_matchcount('abcz','abcde'); 

Returns NULL.

select char_matchcount(null,'abcde');