Using Regexp_extract returns error column does not exist in SQL
I have the following SQL query:
select unique_product_id from inventory where
REGEXP_EXTRACT(unique_product_id, "[^-]*$");
but I get the error: column "[^-]*$" does not exist
[^-]*$
is the regex expression that matches everything after a “-“. My unique_product_id column is of the format: productName-productID
so I am trying to extract productID.
I’m pretty sure I’m following this example exactly: https://docs.data.world/documentation/sql/reference/functions/regexp_extract.html
Any help as to waht I’m doing wrong would be much apprecaited. Thanks