Select * from table where (A like '%AAA%' and A like '%AAA%' and A like '%AAA%') or (B like '%BBB%' and B like '%BBB%' and B like '%BBB%') or (C like '%CCC%' and C like '%CCC%' and C like '%CCC%')