gpt4 book ai didi

SQLite select where 列不包含某些数据

转载 作者:行者123 更新时间:2023-12-03 18:26:22 26 4
gpt4 key购买 nike

好的,所以我有一个看起来像这样的表......(使用管道符号分隔列)

example1 url|0
example2 url|0
example3 url|1
example4 url|1,2
example5 url|1,3,6

我想要做的是选择第 2 列不包含 1 的所有行。

我不能使用 != ,因为如果你只查看其中一个会返回数据,因为最后 2 行不等于 1。我尝试搜索 SQLite 文档以了解如何编写语句,但我找不到它。这是我到目前为止。
select * from table_name where table_column_name[something needed here]'1';

最佳答案

假设“1,2,3”等是字符串,您可能需要 LIKE 关键字。

 select * from table_name where table_column_name NOT LIKE '%1%'

关于SQLite select where 列不包含某些数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19896831/

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