Like

SQL LIKE

The LIKE keyword is used to return rows if the operand matches a pattern.

Syntax

SELECT * FROM name_of_table WHERE name_of_column LIKE pattern;

Example

Table of books

IDNAMEPRICE
1Learn Python45
2MySQL Tutorial32
3PHP examples24
4Learn SQL32
SELECT * FROM books WHERE name LIKE '%Learn%';

Output

IDNAMEPRICE
1Learn Python45
4Learn SQL32
SELECT * FROM books WHERE name LIKE 'MySQL%';

Output

IDNAMEPRICE
2MySQL Tutorial32