Let's say we have a table as under
Record
Othelo
Macbeth
IPL
Performance Tuning
The expected output should be
Record
Othelo
Macbeth
Query
------ DECLARE @t TABLE (Record VARCHAR(500))
INSERT INTO @t
SELECT 'Othelo' UNION ALL
SELECT 'Macbeth' UNION ALL
SELECT 'IPL' UNION ALL
SELECT 'Performance Tuning'
SELECT *
FROM @t
WHERE Record LIKE '%h%'
OR Record LIKE '%b%'
So here we have used LIKE and OR together to accomplish the result.