Jump to content

need query to retrieve names whose first letter is in a range e.g. A-H


mgm_03

Recommended Posts

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.

**RESOLVED ***

select * from products where name regexp '^[a-g|A-G]'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.