I'm trying to query a table, and my criteria requires me to match a literal with a substring of a column, like this:
SELECT .........
FROM issuer_table
WHERE owner = "ABC"
AND {substr logic} = v_cik_nbr;
My column values are like this: "http://www.url.com/data/Archives/931015/000120767912044794/doc4.xml"
So, I've been playing with statements like this:
SELECT SUBSTR(x,1,INSTR(x,'/')-1)
FROM (SELECT SUBSTR('http://www.url.com/data/Archives/931015/000120767912044794/doc4.xml',
INSTR('http://www.url.com/data/Archives/931015/000120767912044794/doc4.xml','/',1,7) +1) AS x
FROM dual);
So, that actually gets me the value I need to compare against: "000120767912044794". But, how to incorporate that into the WHERE clause?