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. How to search word starting with character 'a' Sql Full Text Indexing

How to search word starting with character 'a' Sql Full Text Indexing

Scheduled Pinned Locked Moved Database
databasehelpalgorithmstutorial
2 Posts 2 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
    abhinish
    wrote on last edited by
    #1

    Hi guys, need some help. i am trying to create a Full text index query for searching all the records having words starting with a particular character for eg. 'A' i tried using Contains Clause with '*' wild card my query is :-

    select * from table where contains (columname,'"A*"');

    results are coming fine but the problem is that it returns all the records in which there is any word between the string starting with A . I need only those records in which the starting char of the column is 'A' similar to the query -

    select * from table where columname like 'A%'

    but i dont want to use like query as it will slower the results .. any help will be appreciated

    abhinav

    S 1 Reply Last reply
    0
    • A abhinish

      Hi guys, need some help. i am trying to create a Full text index query for searching all the records having words starting with a particular character for eg. 'A' i tried using Contains Clause with '*' wild card my query is :-

      select * from table where contains (columname,'"A*"');

      results are coming fine but the problem is that it returns all the records in which there is any word between the string starting with A . I need only those records in which the starting char of the column is 'A' similar to the query -

      select * from table where columname like 'A%'

      but i dont want to use like query as it will slower the results .. any help will be appreciated

      abhinav

      S Offline
      S Offline
      SomeGuyThatIsMe
      wrote on last edited by
      #2

      Contains appears to be working exactly like it should, you'll have to use like or construct a more complicated contains clause, if you're using sql server 2k the transact sql help in the query analyzer tool has some decent examples and a rather good explination for almost anything sql.

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      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