I have to find the first sequence of four numbers inside a table using Oracle SQL.
Inside the input_file_name column we can find values as:
RVSP_040517.M
SERIES_040517_CP.TXT
SAUDE_O10N0505.M
SERIES_040517.txt
RVSP_080517.M
SERIES_080517_CP.TXT
As we can see, there is groups of numbers before, but the first group of four numbers from the left is what I want. I want to create a new column with this day-mouth (4) numbers.
How can I do it?
The result I am expecting from this table is:
0405
0405
0505
0405
0805
0805
I was trying to use inStr but it wasn't working