Title - LIKE SQL operator Tags - sql operator programming

LIKE is an operator used with the WHERE clause to search for a specific pattern in a column.

Example:

The movies table contains two films with similar titles -

  1. Se7en
  2. Seven

You could use the LIKE operator to return the rows with both of these values in.

SELECT * FROM movies WHERE name LIKE ‘Se_en’;

LIKE is the operator.

name LIKE ‘Se_en’ is a condition evaluating the name column for a specific pattern.

‘Se_en’ represents a pattern with a wilcard character.

The ’_’ means a value with character between Se and en will be true and be returned in the results.

So, in the example above, Se7en and Seven would be be returned.