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 7913737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:54:47+00:00 2026-06-03T13:54:47+00:00

I started by asking this question I wish to Select all rows which contain

  • 0

I started by asking this question I wish to Select all rows which contain any element from an array
And while my current question is almost identical, it serves a whole different purpose, and so I fear the answer may be different which would obscure the previous one, with that said.

I am working on a search engine type thing. I need to search a title stored in a database to see if it contains any of the words in the search textbox. I plan to then iterate through each of those rows, counting how many words match and ranking the results accordingly. I am sure this has been done many times by now. I just can’t seem to figure out how to do it without

select * from table

then sorting it in c#

  • 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-03T13:54:48+00:00Added an answer on June 3, 2026 at 1:54 pm

    You could try something like this:

    SELECT * FROM table WHERE name LIKE '%word1%' OR name LIKE '%word2%';
    

    The % signs are the analogous to * in typical searches.

    To take the string and create this query for multiple words you could do something like this:

    String inputString = "hello my friend";
    String[] wordlist = inputString.split(" ");
    String query = "SELECT * FROM table WHERE 0=0 ";
    for(String word : wordlist) {
        query += "OR name LIKE '%" + word + "%' "; 
    }
    

    The spaces at the end of the strings are important, don’t forget those! Also, you’ll probably want to sanitize the string before you split it (remove extra punctuation, maybe even remove words like “a” or “the” or “to” etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am asking this question here as I could not find any conclusive results
this question I've been asking myself since the day I started programming in MVC
After asking this question, I started using Sinatra as a way to serve web
I realize that by asking this question, I could have started the apocalypse, but
I started out with this question , which I sort of answered there ,
Started with this question: OpenID. How do you logout OK. So OpenID does not
This is more of knowledge sharing rather than asking a question. Thought this little
I was looking at this question and started wondering what does the print actually
I am not sure exactly what I should name this question. I just started
A few days ago i asked this question: Displaying images from Facebook photo albums

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.