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

  • Home
  • SEARCH
  • 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 7905287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:25:04+00:00 2026-06-03T10:25:04+00:00

I am trying to do a search engine, something like stackoverflow here. I need

  • 0

I am trying to do a search engine, something like stackoverflow here. I need to select all rows that contain any of selected tags.

Table

RowID    Question    Tags
  1        'who'     'C#'
  2       'what'     'SQL'
  3       'where'    'C#,PHP'
  4       'when'     'PHP,SQL'

string[] myTags=new string{"c#","PHP'};

then my sql select statement something like this

Select * from table where Tags like myTags[]

I wish to have results like

RowID    Question    Tags
  1        'who'     'C#'
  3       'where'    'C#,PHP'
  4       'when'     'PHP,SQL'

Of course I know this is syntactically incorrect that is why I am here.

  • 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-03T10:25:05+00:00Added an answer on June 3, 2026 at 10:25 am

    Linq version:

    myTable.Where(x=>myTags.Contains(x.Tag));
    

    Sql Version:

    Select * from table where Tag in {'c#','SQL','PHP'}
    

    If one item can have too many tags, you should change a little your database design (adding relational table), it’s not a good way to have a string which contains too many tags.

    Update:
    For your current DB sample you can do this with linq:

    myTable.Where(x=>myTags.Any(y=>x.Tags.Contains(y)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an application that works like a search engine, and all the
so I am trying to make a simple search engine, that allows a user
I'm trying to build a search engine that will check a list and then
I'm trying to implement Search Engine. I have web application that displays list of
I am trying to programatically perform a search on Microsoft Bing search engine. Here
I am trying to build a search engine using java and the lucene API
I have been trying to create a new google custom search engine, but when
I'm trying to do a location-based search on App Engine, but since the data
I'm trying to make mini search engine for a site containing products. I've already
I am trying to build a simple search-engine using HtmlAgilityPack and Xpath with C#

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.