列字符串到时间
SQL的新事物!我使用BigQuery。 如何将整个字符串列转换为时间? 列名是ride_length,其格式为00:00(分钟:秒)。 架构是字符串,但我需要时间。 那我该如何计算平均水平? 先感谢您。
New in SQL here! I use BigQuery.
How do I convert an entire string column to time?
The column name is ride_length and it's format is 00:00 (minutes:seconds).
On schema is string but I need it to be time.
Also how can I calculate its average then?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为有多种方法可以做到这一点。但是,这完全取决于您如何需要最终结果(甚至处理中间值)。一种方法是,您可以使用Split,Cast&可能计算总数添加,进行平均&将其放回时间数据类型(或以分钟/秒的时间维护)
I think there are multiple ways to do it. But, it totally depends on how you need the end result (or even process the intermediate values). One way is you could possibly calculate the total seconds using split, cast & add, do the average & cast it back to time datatype (or maintain in minutes/seconds)