I need to extract or just retain certain characters from a varying string using SQL in Oracle. I used the SUBSTR function but that does not work for all the cases.
Example: Values are like this:
B2B_BID-XSKU957109
B2B_BID-SKU340535
B2B-SKU342345
B2B_BID-SKU340020201
Results I want:
SKU957109
SKU340535
SKU342345
SKU340020201
So its just not the last 10 characters but I want only the part which has the string 'SKU' and the number following it. I have given all kind of examples I have. Thanks