COL_LIKE

Tests whether an expression column matches a pattern column. Comparisons are case-sensitive.

Syntax

COL_LIKE(expression_col varchar, pattern_col varchar) → boolean

  • expression_col: A column containing an expression to compare.

  • pattern_col: A column containing the pattern to compare to the expression.

Examples

COL_LIKE example
CREATE TABLE $scratch.names (name varchar, pat varchar)
AS VALUES ('john', '%oh%'), ('jacob', '%aco%'), ('bill', '%ob%');

SELECT name 
FROM $scratch.names 
WHERE col_like (name, pat);

-- john
-- jacob

Last updated