Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. search in database- do you have other than "like" ? [modified]

search in database- do you have other than "like" ? [modified]

Scheduled Pinned Locked Moved Database
databasealgorithmsquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abdul Rhman Alsri
    wrote on last edited by
    #1

    When we search with for "mobile" word, using "like" as follows:

    select ID from Table where column like '%mobile%'

    we can get: mobile, bile. But we can not get mobility or mobilization in result, even though they are related words for mobile word we are searching for. So, Do you have solutions to handle those related words, I mean when search for mobile, we can get in result the words mobility and mobilization?

    modified on Thursday, May 6, 2010 3:07 PM

    C T 2 Replies Last reply
    0
    • A Abdul Rhman Alsri

      When we search with for "mobile" word, using "like" as follows:

      select ID from Table where column like '%mobile%'

      we can get: mobile, bile. But we can not get mobility or mobilization in result, even though they are related words for mobile word we are searching for. So, Do you have solutions to handle those related words, I mean when search for mobile, we can get in result the words mobility and mobilization?

      modified on Thursday, May 6, 2010 3:07 PM

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      Abdul-Rhman Alsri wrote:

      related words for mobile word

      Someone needs to define that relationship. One way is to include that in your query

      select ID from Table where column like '% mobile %'
      or column like '% mobilization %'
      or column like '% mobility %'
      ;

      :)

      Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

      A 1 Reply Last reply
      0
      • C Chris Meech

        Abdul-Rhman Alsri wrote:

        related words for mobile word

        Someone needs to define that relationship. One way is to include that in your query

        select ID from Table where column like '% mobile %'
        or column like '% mobilization %'
        or column like '% mobility %'
        ;

        :)

        Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

        A Offline
        A Offline
        Abdul Rhman Alsri
        wrote on last edited by
        #3

        I need it in general, because the word I search for is not determined explicity, but it's also retrieved from database.

        SELECT a.id AS [CampaignID],
        b.id AS [ZoneID],
        a.adheadline,
        a.adtext,
        a.displayurl,
        a.targeturl
        FROM adcampaign a
        INNER JOIN adzone b
        ON a.sitecategory = b.category
        AND a.LANGUAGE = b.LANGUAGE
        AND a.keyword LIKE '%' + b.keyword + '%';

        C 1 Reply Last reply
        0
        • A Abdul Rhman Alsri

          I need it in general, because the word I search for is not determined explicity, but it's also retrieved from database.

          SELECT a.id AS [CampaignID],
          b.id AS [ZoneID],
          a.adheadline,
          a.adtext,
          a.displayurl,
          a.targeturl
          FROM adcampaign a
          INNER JOIN adzone b
          ON a.sitecategory = b.category
          AND a.LANGUAGE = b.LANGUAGE
          AND a.keyword LIKE '%' + b.keyword + '%';

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #4

          Perhaps another table that links similar words is needed. :)

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

          1 Reply Last reply
          0
          • A Abdul Rhman Alsri

            When we search with for "mobile" word, using "like" as follows:

            select ID from Table where column like '%mobile%'

            we can get: mobile, bile. But we can not get mobility or mobilization in result, even though they are related words for mobile word we are searching for. So, Do you have solutions to handle those related words, I mean when search for mobile, we can get in result the words mobility and mobilization?

            modified on Thursday, May 6, 2010 3:07 PM

            T Offline
            T Offline
            T M Gray
            wrote on last edited by
            #5

            What database product are you using? If you are using MS SQL you can use things like SOUNDEX and FREETEXT.

            A 1 Reply Last reply
            0
            • T T M Gray

              What database product are you using? If you are using MS SQL you can use things like SOUNDEX and FREETEXT.

              A Offline
              A Offline
              Abdul Rhman Alsri
              wrote on last edited by
              #6

              SELECT id FROM AdCampaign WHERE FREETEXT(Keyword, 'going');

              Error: Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'AdCampaign' because it is not full-text indexed.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups