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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:33:30+00:00 2026-05-10T23:33:30+00:00

We used to have a search, that checks two columns for some words. Both

  • 0

We used to have a search, that checks two columns for some words. Both columns must contain some words provided, so we use AND … no doubts FULLTEXT INDEX is used on the columns.

The select is more or less like this:

SELECT     *  FROM SomeTable WHERE (CONTAINS(Column1, 'word1 OR word2') AND CONTAINS(Column2, 'word3 OR word4')) 

now we need to add ranking to the result. We would like to use CONTAINSTABLE functionality … for only one column its simple. Something like:

SELECT     SomeTable.*,     tmp.RANK FROM SomeTable INNER JOIN CONTAINSTABLE(SomeTable, Column1, 'word1 OR word2') as tmp ON tmp.[KEY] = SomeTable.ID 

Is it possible to do it with 2 columns BUT consider that I only need to search for word1 or word2 in column1 (not interested if we have word1 or word2 in column2). Also consider AND that was in where clause. Is there something like:

SELECT     SomeTable.*,     tmp.RANK FROM SomeTable INNER JOIN CONTAINSTABLE(SomeTable, (Column1, Column2), 'column1:(word1 OR word2) AND column2:(word3 OR word4)') as tmp ON tmp.[KEY] = SomeTable.ID 
  • 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. 2026-05-10T23:33:31+00:00Added an answer on May 10, 2026 at 11:33 pm

    You can do this with an inner join on a second containstable, although you might want to do something a bit fancier than adding the ranks together as I have in the sample

    SELECT     SomeTable.*,         col1.RANK + col2.RANK FROM      SomeTable INNER JOIN CONTAINSTABLE(SomeTable, Column1, 'word1 OR word2') as col1 ON      col1.[KEY] = SomeTable.ID INNER JOIN CONTAINSTABLE(SomeTable, Column2, 'word3 OR word4') as col2 ON      col2.[KEY] = SomeTable.ID 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Have you considered ADO.NET Data Services? This allows you to… May 11, 2026 at 12:35 pm
  • added an answer Socket is enough if no firewalls/proxies are involved. But, as… May 11, 2026 at 12:35 pm
  • added an answer If you add the FSharp Powerpack to your project (in… May 11, 2026 at 12:35 pm

Related Questions

I have a .Net 2.0 app that is used internally and we want to
We have always had languages that were preferable to be used in a particular
In our code we used to have something like this: *(controller->bigstruct) = ( struct
We used to use SourceSafe, and one thing I liked about it was that
This is a bit of a stretch, but I have an interesting (to me)
We have an Access DB which has a set of local tables and input
I was trying to add the XML schema to an existing EJB project. JAXB
We have a number of projects that use the same and/or similar package names.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.