Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的表格中有一个类型SET('alpha','beta','gamma','delta','...','omega')和名称为“字母”的列
SET('alpha','beta','gamma','delta','...','omega')
我的 PHP 查询是
$string = "伽玛"
SELECT * FROM table WHERE alphabet LIKE "%$string%"
因此,我想返回gammacolumn 中的所有行alphabet,而不管其他值也在那里,因为它是 SET 类型。
gamma
alphabet
sql查询会是什么?
SELECT * FROM table WHERE find_in_set('$string', alphabet) > 0
FIND_IN_SET 文档