gpt4 book ai didi

mysql - SQL 包含或喜欢

转载 作者:太空宇宙 更新时间:2023-11-03 10:31:48 26 4
gpt4 key购买 nike

我希望在查找“word 1”或“word 2”的列上运行查询,如果其中任何一个存在,结果需要包含“Word 3”

该列本身可能很大,其中包含大量文本,这是我目前所拥有的,它不会返回我正在寻找的内容:

SELECT * 
FROM Table1
WHERE column LIKE "%word.1%" OR
column LIKE "%word.2%" AND
column LIKE "%word3%";

提前致谢

最佳答案

您应该使用 () 来管理两个 OR 条件

SELECT * 
FROM Table1
WHERE ( column LIKE "%word.1%" OR column LIKE "%word.2%" )
AND column LIKE "%word3%" ;

关于mysql - SQL 包含或喜欢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56666841/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com