Are These Two String Values Like Each Other?

Posted March 7, 2019 by Jim Knicely, Vertica Principal Solution Architect

The Vertica built-in function LIKE is used to determine if two strings are like one another, while the NLIKE function is used to determine if two strings are not like one another.

Example: dbadmin=> SELECT LIKE('ABCDEF', 'ABCDEF'); LIKE ------ t (1 row) dbadmin=> SELECT NLIKE('ABCDEF', 'ABCDEF'); NLIKE ------- f (1 row) You can even include wildcard symbols! dbadmin=> SELECT LIKE('ABCDEF', '%DE%'); LIKE ------ t (1 row) dbadmin=> SELECT NLIKE('ABCDEF', '%DE%'); NLIKE ------- f (1 row) dbadmin=> SELECT LIKE('ABCDEF', 'A%F'); LIKE ------ t (1 row) dbadmin=> SELECT NLIKE('ABCDEF', 'A%F'); NLIKE ------- f (1 row)