gpt4 book ai didi

sql - 搜索长 varchar SQL

转载 作者:搜寻专家 更新时间:2023-10-30 19:46:34 25 4
gpt4 key购买 nike

我在 Ingres 9.2.0 中有一个数据库,其中包含一个长 varchar 列。有什么方法可以让我在该列中搜索特定字符串,并只返回列中包含该字符串的行。

我试过像下面这样使用

select * from table
where col like '%abc%'

但是我得到以下错误

Function 'like' is not defined for arguments of type 'long varchar' and 'varchar'. Explicitly convert its arguments to the desired type(s).


我能够通过以下查询解决这个问题

select * from table WHERE position('abc' in col) > 0

最佳答案

针对 LONG VARCHAR 的 LIKE 支持已添加到 Ingres 9.3.0(project page - 如果您有较早的版本,这将不起作用。请参阅 feature list 以了解所有 9.3 更改。

关于sql - 搜索长 varchar SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8503440/

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