The environment I am currently working in is Snowflake. As a matter of data sensitivty, I will be using pseudonyms for my following question.
I have a specific field in one of my tables called FIELD_1. The data in this field is structured as such:
The idea is to use a query to pull FIELD_2 from FIELD_1.
I have been trying out this query:
SELECT FIELD_1, SUBSTRING(PROMOTION_NAME, 1,13) AS FIELD_2 FROM TABLE 1;
This query would work if all my strings in FIELD_1 had the same number of characters. That is not the case. Ideally, I would need to be able to extract from FIELD_1 all characters up until the first 4 numbers, without the underscores. Anybody have any idea what kind fo query would get me this output?
Thanks!
