Home > Back-end >  Using Regex to extract decimal numbers from arrays on Snowflake
Using Regex to extract decimal numbers from arrays on Snowflake

Time:05-11

The column ('DATA') I want to extract the decimal from is in the following format:

{ "unit": "Miles", "value": 59290.6 }

I've tried the following code by I get a null...

regexp_substr(DATA, '\{\d .\d \}') AS RECORDED_DISTANCE

CodePudding user response:

Do you just mean to access the value element?

select
    data:value as record_distance
  • Related