In SQL, Is there any way to Shorten syntax From
Select * from TableName
where ColumnName like \'%A%\' or ColumnName like \'%B\' or ColumnName like \'C%\'
No there isn't a way to combine LIKE with IN directly
There are ways around this, like this example for SQL Server
Select *
from
TableName T
JOIN
(VALUES ('%A%'),('%B'),('C%')) AS X(Expression) ON T.ColumnName LIKE X.Expression
This changes multiple OR search conditions into rows and a JOIN
Or you can use a UNION to combine several queries in one
Select * from TableName
where ColumnName like '%A%'
union
Select * from TableName
where ColumnName like '%B'
union
Select * from TableName
where ColumnName like 'C%'