AdvancedWHERE & Filtering

Find rows where any column contains a keyword

The query

SQL
SELECT emp_id, first_name, last_name, email, job_title
FROM employees
WHERE first_name ILIKE '%john%'
   OR last_name ILIKE '%john%'
   OR email ILIKE '%john%'
   OR job_title ILIKE '%john%';
Tested against PostgreSQL 16

Note

Multi-column ILIKE search. In production, use full-text search or a tsvector index for performance.

Tables referenced