I need a query that will retrieve rows based on the first letter of the product name. The user will choose from A-G, H-P, or R-Z (maybe the ranges will be more granular) and I need to return all the products whose name begins with a letter in one of those ranges.
I am guessing that a regex is needed but after that I'm clueless. Any advice is appreciated and if there's an explanation somewhere on the web, pls point me there. I'm not sure what to google for.
select * from products where name regexp '^[a-g|A-G]'
need query to retrieve names whose first letter is in a range e.g. A-H
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users