Link to home
Start Free TrialLog in
Avatar of sikyala
sikyalaFlag for United States of America

asked on

what is syntax for stripping characters from a field value and leaving the remaining to query against another field

I need to get the latter characters from a field and compare it with the field value in another table. What is the syntax to strip the characters that I don't need and use only the characters I do need in a query?

This is what I have:

select count(*) from dc_rule
where Doc_I in
(select pdf from holdings
  where pub_date >='01-JAN-10'
              and pub_date<='31-DEC-10');

dc_rule field has the following value:

RDBAFM_ORA10://cpia_lib/CPIA-1995-0525

I don't want to remove any characters. I just want to capture a portion of the value of the field and compare it to another field. For example I only want CPIA-1995-0525 in the above sample. Is that possible? If so How would I do this?


ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sean Stuber
Sean Stuber

if the rule for extracting the piece you want is something else, please specify and I'll adjust accordingly
Avatar of sikyala

ASKER

I basically want to exclude RDBAFM_ORA10://cpia_lib/
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sikyala

ASKER

sdstuber: exactly it worked. Thanks
Avatar of sikyala

ASKER

Thanks