How to find elements that are not part of the alphabet
In my opinion, I have an alphabet based selector to select manufacturers by the first letter of their name. I got this piece to work. But I have manufacturers whose name starts with a number, like 3M or 3DLabs. In the view, I have a "#" symbol to group the whole thing. What should my query / find method look like to get all names that don't start with a letter of the alphabet.
+1
railsnewbie
source
to share
2 answers
You probably want to use a regular expression.
What language are you using?
Here is the SQL2005 version:
select *
from myTable
where myField like '[^a-z]%'
+2
Mitchell Gilman
source
to share
I think I got it
SELECT * FROM manufacturers
WHERE (REGEXP name '^ [0-9]') ORDER BY name
+1
railsnewbie
source
to share