Files
doris/docs/en/sql-reference/sql-functions/string-functions/like/like.md
EmmyMiao87 15c5896f41 [Docs] Add like, regexp function documents (#6182)
* [Docs] Add like, regexp function documents

* Reconstruct

* Fix compile error
2021-07-15 13:16:21 +08:00

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