# Using LIKE for a Range of Numbers

In my WHERE clause, I'm trying to use LIKE for a range of numbers. For example:

``````WHERE rr.sequence LIKE '05600%'
OR rr.sequence LIKE '05601%'
OR rr.sequence LIKE '05602%'
OR rr.sequence BETWEEN LIKE('056035%' AND '056038%')
``````

Otherwise, I would need to use a LIKE statement for each potential number combination between `'056035%' and '056038%'`

• Cant you use `like '0560[0-9]%'` ? This translates to `05601...9`. Also, storing numbers as strings is not a good idea. – Kin Shah Jan 17 at 21:37
• Check the length of these number-strings as '05600%' will match '056001' and also '05600999999999999'. To wit an actual CHECK may be appropriate. – Michael Green Jan 18 at 1:58
• Upon further review, you're exactly right. How else would I go about filtering the Sequence range that includes: '0560%' thru '05608985%' – Mike Jones Jan 18 at 22:49
• Will these values all have the same number of digits? On other words, if they were all actual numbers instead of numbers-as-strings, would they all be of the same order of magnitude? Are there any business rules saying what the lower and upper values in any search could be? – Michael Green Jan 24 at 10:54

``````OR rr.sequence LIKE '05603[5-8]%'