0

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.

Pars
  • 413
  • 9
  • 14
Gayathri
  • 339
  • 2
  • 15
  • 26

3 Answers3

1

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]+.*$'); 
Maks
  • 202
  • 1
  • 9
  • 1
    but also I'd like to mention that using regular expressions may dramatically slow down your performance on a big datasets. If you need to run queries like that it's very possible that it's something wrong with your design, or maybe you need some additional indexer in from of your database. – Maks May 06 '15 at 11:31
0

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

JhWOLFJh
  • 67
  • 2
  • 15
0

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.

Pars
  • 413
  • 9
  • 14