Here is my mySQL query:
SELECT *
FROM `eodList`
WHERE datechanged>='$curdate'
GROUP BY symbolName
ORDER BY dateChanged DESC
How do I get all rows (for example) where symbolName
starts with letters A-F
?
Update:
I need something that can be easily changed to another range without alot of code changes.
Faster than
Regular expressions
andSUBSTRING()
function calls. This will use the index ofsymbolName
:There is an issue with the case sensitivity though. Do you want names which start with
a..f
too or not?If you want only names that start with uppercase and the table has
utf8
character set, use:For other character sets, use the corresponding
_bin
collation.Try with Regex