sql like case insensitive code example

Example 1: sql like case sensitive

-- Postgresql case insensitive:
SELECT * FROM people WHERE name ILIKE 'JOHN'
-- John
-- JOHN
-- john

Example 2: case insensitive sql

-- find everyone with  first_name contains d case insensitive manner
Make everthing either lower or upper case

SELECT FIRST_NAME , LAST_NAME 
FROM EMPLOYEES 
WHERE LOWER(FIRST_NAME) LIKE '%d%' ;

Example 3: where case insensitive like mysql

When searching for partial strings in MySQL with LIKE you will match case-insensitive by default.

SELECT name FROM users WHERE name LIKE 't%'

Tags:

Sql Example