cast(TotalMinutesAsleep as float64)/60 as sleep_hr
结果显示,例如,5.3666666
,但我只想要5.3
。
根据来源可以使用ROUND
函数
这个应该能奏效:
round(cast(TotalMinutesAsleep as float64)/60,1) as sleep_hr
来源:https://cloud.google.com/bigquery/docs/reference/standard-sql/mathematical_functions轮
同样有趣的是:https://www.w3schools.com/sql/func_mysql_round.asp