find_in_set > 0
时间: 2023-08-25 14:17:41 浏览: 48
`FIND_IN_SET` is a MySQL function that searches for a value within a comma-separated list. It returns the position of the value in the list if found, otherwise it returns 0. It can be used in queries to check if a specific value exists in a list.
Here is an example of using `FIND_IN_SET` to check if a value is present in a comma-separated list:
```sql
SELECT column_name
FROM table_name
WHERE FIND_IN_SET('value', column_name) > 0;
```
In this query, `column_name` is the column that contains the comma-separated list, and `'value'` is the value you want to check for. If the value is found in the list, `FIND_IN_SET` will return a position greater than 0, and the row will be included in the result.
Note that using comma-separated lists in database columns is generally not recommended as it can make querying and manipulating data more complex. It's usually better to use separate rows or a separate table for related values.