943,832 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 779
  • MySQL RSS
Nov 21st, 2008
0

suggest query

Expand Post »
hi all,
i have a auto suggestion box which displays countries when we type a it will display all countries starting with letter a like alaska,australia etc...,but i want to display every name which has letter a in names like australia,india,
etc...
Similar Threads
Reputation Points: 21
Solved Threads: 29
Posting Whiz in Training
praveen_dusari is offline Offline
202 posts
since Jun 2008
Nov 21st, 2008
0

Re: suggest query

sql Syntax (Toggle Plain Text)
  1. SELECT * FROM countries WHERE country LIKE '%a%'
Last edited by peter_budo; Nov 28th, 2008 at 12:10 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 729
Bite my shiny metal ass!
pritaeas is offline Offline
4,176 posts
since Jul 2006
Dec 1st, 2008
0

Re: suggest query

If there are small number of rows in a table u can go with Like '%a%'
else you need to try full text index
Reputation Points: 22
Solved Threads: 9
Junior Poster in Training
varmadba is offline Offline
83 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Converting queries from MySQL 4 to MySQL 5
Next Thread in MySQL Forum Timeline: getting the 3 queries as optimised single query.. is this possible





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC