Gayathri
Gayathri

Reputation: 349

How to use Regex_Like for this case?

I have a field named Order_ID from table Order.

when value of Order_ID starts with numeric value then it should exclude those records, otherwise it should include those records in the report.

For example: if the Order_ID starts with a value 1ABC it should exclude that record from report .

If Order_ID has a value A1BC it should not exclude those records.

Upvotes: 0

Views: 77

Answers (3)

JhWOLFJh
JhWOLFJh

Reputation: 67

This is the regex statement (Order_ID, "[A-Z]{1}\d{1}[A-Z]{3}")

Upvotes: 0

Pars
Pars

Reputation: 413

Gayatri,
put following in report where condition

WHERE NOT REGEXP_LIKE(Order_ID, '^[0-9]');

report it exclude entries start with numbers and contains values start with Alphabetics only.

Hopes this helps.

Upvotes: 0

Maks
Maks

Reputation: 202

http://docs.oracle.com/cd/B12037_01/server.101/b10759/conditions018.htm#SQLRF00501

for your particular case it's going to be something like

SELECT ... WHERE REGEXP_LIKE (Order_ID, '^[a-zA-Z]+.*$'); 

Upvotes: 1

Related Questions