1.6 KiB
1.6 KiB
title, language
| title | language |
|---|---|
| like | en |
like
description
syntax
'BOOLEAN like(VARCHAR str, VARCHAR pattern)'
Perform fuzzy matching on the string str, return true if it matches, and false if it doesn't match.
like match/fuzzy match, will be used in combination with % and _.
'a' // Precise matching, the same effect as =.
'%a' // data ending with a
'a%' // data starting with a
'%a%' // data containing a
'a' // Three digits and the middle letter is a
'a' // Two digits and the ending letter is a
'a' // Two digits and the initial letter is a
example
// Return the data containing a in the k1 string
mysql> select k1 from test where k1 like '%a%';
+-------+
| k1 |
+-------+
| a |
| bab |
+-------+
// Return the data equal to a in the k1 string
mysql> select k1 from test where k1 like 'a';
+-------+
| k1 |
+-------+
| a |
+-------+
keyword
LIKE