Way to remove double quotes and convert data type to string in Google BigQuery
P粉481035232
2023-08-15 11:25:31
<p>The values are of JSON object type and I want to change them to strings and remove the double quote symbols. I tried the replace and trim functions but they require strings as input. <br />I also tried the replace, trim and cast functions, but they require the input to be in string format. <br />Select replace(cast([column name] as string), """) from [table name]</p>
To convert a
JSON
column toSTRING
, you can use theJSON_EXTRACT_SCALAR
function. Example:Output results: