sikyala
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/CP IA-1995-05 25
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?
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/CP
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if the rule for extracting the piece you want is something else, please specify and I'll adjust accordingly
ASKER
I basically want to exclude RDBAFM_ORA10://cpia_lib/
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sdstuber: exactly it worked. Thanks
ASKER
Thanks