gpt4 book ai didi

mysql - 无法使用 in 子句获取逗号分隔值

转载 作者:行者123 更新时间:2023-11-30 22:58:32 26 4
gpt4 key购买 nike

您好,我有一个表格,其中包含以逗号分隔的数字值,架构/字段如下所示

首选位置 - 0,161,186,263

preferred_location 数据类型是长文本

我尝试使用下面的查询获取 preferred_location 161 的行

 select * from tablename where preferred_location in(161)

但没有得到任何结果

最佳答案

尝试:

select * from tablename where  find_in_set(preferred_location, '0,161,186,263') <> 0

关于mysql - 无法使用 in 子句获取逗号分隔值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25112609/

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