如何使用 SQLite FTS3 匹配表中的多列?

编程入门 行业动态 更新时间:2024-10-24 10:18:39
本文介绍了如何使用 SQLite FTS3 匹配表中的多列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

假设我有一个包含 A、B、C、D 列的表格,我想在 A 列和 C 列上进行匹配

Lets say I have a table with columns A , B , C , D and I want to do a match on column A and C

我看到您可以匹配sqlite中的单个列或所有列

I see that you can either match a single column or all column in sqlite ie

- match column A select * from table where A match 'cat' - match all columns select * from table where table match 'cat'

是否可以只匹配 A 列和 C 列?如果没有,你们如何解决这个问题?

Is it possible to match only columns A and C? If not, how do you guys get around this?

感谢您的建议!

推荐答案

我认为您不能在单个 FTS 查询中使用多个 MATCH 运算符.使用 column_name:target_term 使用一次全文搜索来搜索多列.

I don't think you can use multiple MATCH operators in a single FTS query. Use column_name:target_term to search multiple columns using one full text search.

SELECT * FROM table WHERE table MATCH 'A:cat OR C:cat'

www.sqlite/fts3.html#termprefix

更多推荐

如何使用 SQLite FTS3 匹配表中的多列?

本文发布于:2023-11-28 19:35:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643689.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   SQLite

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!