mysql contains
时间: 2023-10-24 08:09:00 浏览: 80
mysql
MySQL contains is a keyword used in SQL queries to match a string within another string. It is used in combination with the LIKE operator. The syntax for the MySQL contains statement is as follows:
```
SELECT column_name FROM table_name WHERE column_name LIKE '%search_string%';
```
In this query, '%' is a wildcard character that matches any number of characters, and 'search_string' is the string you want to search for within the column_name.
For example, if you have a table named "users" with a column named "name", and you want to find all users whose name contains the string "john", you would use the following query:
```
SELECT * FROM users WHERE name LIKE '%john%';
```
This query would return all rows from the "users" table where the "name" column contains the string "john".
阅读全文