Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8739673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:58:54+00:00 2026-06-13T10:58:54+00:00

Short story. I am working on a project where I need to communicate with

  • 0

Short story. I am working on a project where I need to communicate with SQLite database. And there I have several problems:

There is one FTS table with nodeId and nodeName columns. I need to select all nodeIds for which nodeNames contains some text pattern. For instance all node names with “Donald” inside. Something similar was discussed in this thread. The point is that I can’t use CONTAINS keyword. Instead I use MATCH. And here is the question itself: how should this “Donald” string be “framed”? With ‘*’ or with ‘%’ character? Here is my query:

SELECT * FROM nodeFtsTable WHERE nodeName MATCH "Donald"

Is it OK to write multiple comparison in SELECT statement? I mean something like this:

SELECT * FROM distanceTable WHERE pointId = 1 OR pointId = 4 OR pointId = 203 AND distance<200

I hope that it does not sound very confusing. Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:58:55+00:00Added an answer on June 13, 2026 at 10:58 am

    Edit: Sorry, I missed the fact that you are using FTS4. It looks like you can just do this:

    SELECT * FROM nodeFtsTable WHERE nodeName MATCH 'Donald'
    

    Here is relevant documentation.

    No wildcard characters are needed in order to match all entries in which Donald is a discrete word (e.g. the above will match Donald Duck). If you want to match Donald as part of a word (e.g. Donalds) then you need to use * in the appropriate place:

    SELECT * FROM nodeFtsTable WHERE nodeName MATCH 'Donald*'
    

    If your query wasn’t working, it was probably because you used double quotes.

    From the SQLite documentation:

    The MATCH operator is a special syntax for the match()
    application-defined function. The default match() function
    implementation raises an exception and is not really useful for
    anything. But extensions can override the match() function with more
    helpful logic.

    FTS4 is an extension that provides a match() function.

    Yes, it is ok to use multiple conditions as in your second query. When you have a complex set of conditions, it is important to understand the order in which the conditions will be evaluated. AND is always evaluated before OR (they are analagous to mathematical multiplication and addition, respectively). In practice, I think it is always best to use parentheses for clarity when using a combination of AND and OR:

    --This is the same as with no parentheses, but is clearer:
    SELECT * FROM distanceTable WHERE 
        pointId = 1 OR 
        pointId = 4 OR 
        (pointId = 203 AND distance<200)
    
    --This is something completely different:
    SELECT * FROM distanceTable WHERE 
        (pointId = 1 OR pointId = 4 OR pointId = 203) AND
        distance<200
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a project I'm working I need to have some sort of enumaration class
To cut a long story short, my project (an iPhone app) was all working
Long story short, I'm working on a .NET profiler that at one point gets
In a project I am working on, we have several disposable classes. What I
I'm currently working on an iOS game where, long story short, I need to
So long story short, im working with some jquery tabs and im using this
So to make a long story short, I've been working on a web app
Long story short, I have an ASP.NET application I'm trying to debug and at
Long story short, the database I'm using needs to get looked at. Until that
In a project I'm working on, I have an object that is a sort

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.