how to make query on all words in a sentence ?

Discussion in 'MySQL' started by ramysarwat, Nov 14, 2009.

  1. #1
    how can i show all resualts related to all words in a sentence

    for example when i try
    select * from 'table' where 'query' like '%a b c d e f g%'

    i get all results contain this value only "a b c d e f g"

    but i want show all result contain this words in any order or place
     
    ramysarwat, Nov 14, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    use match against.
    1. Create full text index on column on which you wish to search.
    2. Use query like match(COLUMN) against('a b c d e f g')
     
    mastermunj, Nov 14, 2009 IP