469,167 Members | 1,256 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,167 developers. It's quick & easy.

SQL lertter Exclude ... like 'd%'

dan
ok, I am trying to select information from the database by the first letter
of a field such as
"SELECT id,band_name FROM bands WHERE band_name LIKE '".$letter."%' "
$letter is the variable with the letter in it.
--this SELECT statement works fine.

the problem is when I try to select everything else besides the alphabet.
(0-9) or ($,%,#,@)
I have tried
"WHERE band_name NOT LIKE 'a%' and 'b%' etc..."
doesn't work
I also tried:
"SELECT id,band_name FROM bands WHERE band_name NOT LIKE expr REGEXP
([a-z]%)"

can anyone tell me how I can select bands that begin with numbers or
Characters and not the ones that start with a letter??

thanks
Jul 19 '05 #1
0 1821

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by could ildg | last post: by
1 post views Thread by Rajesh Abraham | last post: by
4 posts views Thread by Glen Parker | last post: by
1 post views Thread by John Dalberg | last post: by
9 posts views Thread by paul.jameson | last post: by
2 posts views Thread by Arsen V. | last post: by
3 posts views Thread by KJ | last post: by
1 post views Thread by AntiChrist | last post: by
10 posts views Thread by Simon Brooke | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.