Skip to content

SIMILAR

SELECT
first_name,
last_name
FROM
employees
WHERE
REGEXP_LIKE (first_name, '^B')
AND last_name SIMILAR TO '%son%';
FIRST_NAME | LAST_NAME
-----------|----------
Ben | Johnson
Bill | Allison

The query retrieves employee records where the first name begins with ‘B’ and the last name contains ‘son’. The REGEXP_LIKE function filters on the first_name to get all those beginning with ‘B’, while the SIMILAR TO mechanism filters on last_name to retrieve all containing ‘son’.