If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Begins with

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-04, 10:03
thesandman thesandman is offline
Registered User
 
Join Date: Jul 2004
Posts: 6
Question Begins with

How do I search for text that begins with "a"?
Thanks
Reply With Quote
  #2 (permalink)  
Old 07-09-04, 10:33
vududoc vududoc is offline
Registered User
 
Join Date: Jul 2001
Location: NC
Posts: 102
Use the "%" wildcard, and WHERE <fieldname> LIKE clause in SQL statement. If you put the wildcard after the letter you are searching for, the letter will be first. If you put the wildcard before the letter, it will be the last letter. If you put the wildcard before and after the letter, it will look for it anywhere in that field.
Reply With Quote
  #3 (permalink)  
Old 07-09-04, 11:04
thesandman thesandman is offline
Registered User
 
Join Date: Jul 2004
Posts: 6
Quote:
Originally Posted by vududoc
Use the "%" wildcard, and WHERE <fieldname> LIKE clause in SQL statement. If you put the wildcard after the letter you are searching for, the letter will be first. If you put the wildcard before the letter, it will be the last letter. If you put the wildcard before and after the letter, it will look for it anywhere in that field.
Vududoc, Thanks for the help - it get exectly what I needed. Based ont his question, how would I search for titles that do not begin with letters, but do begin with numbers or other character?
Thanks
Reply With Quote
  #4 (permalink)  
Old 07-09-04, 11:23
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
I'd use NOT LIKE to exclude rows that match a pattern.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On