简体   繁体   中英

I have time 00:07:35.000000 in string format. How to change this to time format in bigquery?

SELECT ride_time, CAST (ride_time as INTERVAL) as ride_time_hr

ride_time -> str 00:07:35.000000

I am expecting 00:07:35

You can use the PARSE_TIME function:

SELECT ride_time, PARSE_TIME("%H:%M:%E*S", ride_time) as ride_time_hr

Output:

在此处输入图像描述

More info:

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