Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

filter by range and specific values in Oracle query.

Good Morninging experts,

I am writing a query but I have to filter on a specific field that contains exact values as well as ranges.  The field is a varchar but the values look like numbers.

for example I need to filter on field called proc_code with the following values.
17.31 thru 17.36,
17.39,
45.03,
45.26,
45.41,
45.71-45.81,
45.92 -45.95,
46.12,
46.18,
46.75

Any assitance would be greatly appreciated.
0
Butterfly2
Asked:
Butterfly2
1 Solution
 
slightwv (䄆 Netminder) Commented:
Is that sample 10 rows from proc_code or one row?

What is your search criteria?

Can you provide some sample results?
0
 
DavidSenior Oracle Database AdministratorCommented:
At face value,
... WHERE proc_code IN ("17.39","45.03",(fill here)"46.75")
OR REGEXP_LIKE (TO_NUMBER(proc_code), ^(17.3[1-6])$))
OR REGEXP_LIKE (TO_NUMBER(proc_code), ^(45.[7-8]1)$))
OR REGEXP_LIKE (TO_NUMBER(proc_code), ^(45.9[2-5])$))
0
 
Butterfly2Author Commented:
ok I was doing and instead of or, I feel so stupid,  Anyway dvz you get the points b/c I saw the or in example.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now