简体   繁体   中英

Bigquery Regexp_Extract Question - Extracting Only the First Name (mid placement) from Full Name Field

I want to use the Regexp_Extract function to isolate the first name from this string.

Full Name
Scott, John Smith
Jackson, Adrian Lee
Park, Julie Ann

Desired Output

John
Adrian
Julie

Thanks!

You seem to want the first string after the comma. That would be:

select regexp_extract(full_name, ', ([^ ]+)') as first_name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM