Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Unanswered: Checking whether a field in a table contains a specified string

    Hello Everyone,


    I have a table with 2 fields...
    say
    TextID and TextValue.


    ------- -------------------------------
    TextID TextValue
    ------- -------------------------------
    101 hello every one
    108 hey hello dear
    121 please say hello
    143 home sweet home

    What i want is a query that will select all the TextID's from the table where
    TextValue field contains the word "hello".

    Any help is deeply appreciated.

    thanks in advance...

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Hunky
    Any help is deeply appreciated.
    this is really basic SQL

    maybe you should take a tutorial

    Code:
    SELECT TextID
      FROM daTable
     WHERE TextValue LIKE '%hello%'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •