If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > REGEXP - querying a range of mid-values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-21-04, 15:49
jorgen180 jorgen180 is offline
Registered User
 
Join Date: Mar 2004
Posts: 3
REGEXP - querying a range of mid-values

Hi everyone.


I need a kind of a specific query, that would select a range of records.

Having a MySql table containing records with this pattern:


BRF-100-TLE
BRF-101-TLE
BRF-102-TLE
...
BRF-999-TLE

+ other sequences of this kind, for e.g.:

ARF-100-TLH
ARF-101-TLH
ARF-102-TLH
...
ARF-999-TLH



I'd like to select just the records inside the mid-value range, in other words...

...If user wants to select records with BRF as a prefix and TLE as a suffix, having mid-value range from 100-200,

SELECT result would be:

BRF-100-TLE
BRF-101-TLE
...
BRF-200-TLE


(although there are values beyond BRF-200-TLE)



Been experimenting with REGEXP:

SELECT from my_table
WHERE UserID REGEXP "^BRF-[100-200]"


...but it's beyond my SQL knowledge to figure out the complete formula


Seeing you guys in action around here, I'm confident you'll have something to suggest on this subject


Thnx in forward !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On