使用cast将不同数据类型转化为同一数据类型,然后使用case when进行处理
示例代码:
SELECT case when column_name = 'string_value' then cast(string_value as INT64) when column_name = 'bool_value' then cast(bool_value as INT64) when column_name = 'float_value' then cast(float_value as INT64) when column_name = 'numeric_value' then cast(numeric_value as INT64) when column_name = 'timestamp_value' then cast(timestamp_value as INT64) end as processed_value FROM table_name