简体   繁体   English

如何在 BigQuery 中将日期转换为星期几?

[英]How to convert date into day of the week in BigQuery?

I have a column of dates and I was wondering how I could add another column to show the day of the week?我有一列日期,我想知道如何添加另一列来显示星期几?

数据截图

see below example看下面的例子

select 
  extract(dayofweek from date('2022-03-02')) as dayofweek_as_number,
  format_date('%a', date('2022-03-02')) as dayofweek_abbreviated,
  format_date('%A', date('2022-03-02')) as dayofweek_fullname       

with output与 output

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM