i want to extract character from 'forecast_version_number' column.
this column contains value 'Sales Planning Forecast 3' I want to extract value '3' from it.
how can i do it.
I have used following code:
select substr('Forecast_Version_Num',character_length('Forecast_Version_Num')-1,character_length('Forecast_Version_Num')) from edwwt.SIP_ESSBSE_FCT_STG;
I think your SQL would give you the integer extracted out of your forecast_version_number field.
If you want to extract characters from the forecast_version_number field, you could do SUBSTR from 1 to the second last character of the field - character_length('Forecast_Version_Num')-1 - that will extract characters out (provided integer value is always at the end).