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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. searching problem in SQL server 2005

searching problem in SQL server 2005

Scheduled Pinned Locked Moved Database
databasehelpsql-serversysadminalgorithms
4 Posts 3 Posters 1 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.
  • H Offline
    H Offline
    hvgyufg28fh38tyr78hf
    wrote on last edited by
    #1

    hai all i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table its returning wrong results. my table contains, dable datas table_1 is table name number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify us the day you roll check roll-over. 4 notify us the day you roll check roll over. my query is select * from table_1 WHERE CONTAINS(text1, '"roll-over"') select * from table_1 WHERE CONTAINS(text1, 'roll-over') in both case i am getting below results. results number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify us the day you roll check roll-over. 4 notify us the day you roll check roll over. here it should return only one result insted of four. is there any thing wrong in Query if not can any one help to from the correct query. i think Bcoz os hyphen the result is returinig either roll or over presents. thanks mahe

    _ 1 Reply Last reply
    0
    • H hvgyufg28fh38tyr78hf

      hai all i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table its returning wrong results. my table contains, dable datas table_1 is table name number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify us the day you roll check roll-over. 4 notify us the day you roll check roll over. my query is select * from table_1 WHERE CONTAINS(text1, '"roll-over"') select * from table_1 WHERE CONTAINS(text1, 'roll-over') in both case i am getting below results. results number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify us the day you roll check roll-over. 4 notify us the day you roll check roll over. here it should return only one result insted of four. is there any thing wrong in Query if not can any one help to from the correct query. i think Bcoz os hyphen the result is returinig either roll or over presents. thanks mahe

      _ Offline
      _ Offline
      _Damian S_
      wrote on last edited by
      #2

      What about:

      select * from table_1 where text1 like '%roll-over%'

      I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

      H 1 Reply Last reply
      0
      • _ _Damian S_

        What about:

        select * from table_1 where text1 like '%roll-over%'

        I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

        H Offline
        H Offline
        hvgyufg28fh38tyr78hf
        wrote on last edited by
        #3

        thanks for ur reply its working fine. but is there any way to form query with CONTAINS key word. mahe

        M 1 Reply Last reply
        0
        • H hvgyufg28fh38tyr78hf

          thanks for ur reply its working fine. but is there any way to form query with CONTAINS key word. mahe

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          From BOL Is a predicate used to search columns containing character-based data types for precise or fuzzy (less precise) matches to single words and phrases, the proximity of words within a certain distance of one another, or weighted matches. So you used a fuzzy search key word, got a fuzzy return when you wanted a precise return. Wrong tool for the job.

          Never underestimate the power of human stupidity RAH

          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