gpt4 book ai didi

sqlite - SQLite WHERE子句被忽略

转载 作者:行者123 更新时间:2023-12-03 15:21:36 25 4
gpt4 key购买 nike

我有一个非常简单的查询,该查询返回的结果我很确定不应该包括在内。

CREATE TABLE hits
AS SELECT *
FROM deduped_table
WHERE Bank LIKE '%monex%' OR Bank LIKE '%cibanco%' OR Bank LIKE '%intercam%'
AND (Bank_Country = 'US' OR Bank_Country = 'United States');


当我查看命中表时,Bank_Country列的结果不是“ US”或“ United States”。为什么?

最佳答案

加上括号以显示SQL's precedence rules,您的查询是:

SELECT *
FROM deduped_table
WHERE Bank LIKE '%monex%'
OR Bank LIKE '%cibanco%'
OR (Bank LIKE '%intercam%' AND
(Bank_Country = 'US' OR Bank_Country = 'United States'));

关于sqlite - SQLite WHERE子句被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47799096/

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