格式化时间戳和日期
当以文本形式查看时间戳(例如 '2020-06-02 23:57:12.120174 UTC')时,往往不直观,尤其是在报告中。确保报告易于理解,会影响他人如何使用您的分析结果。
本练习是课程的一部分
BigQuery 入门
练习说明
- 使用
%D选项,将order_purchase_timestamp列的日期格式化为'MM/DD/YY'。
交互式实操练习
通过完成这段示例代码来试试这个练习。
-- Fill in the query to find the three days with the most orders
SELECT
-- First, add the date formatting for dates
FORMAT_TIMESTAMP(___, ___) AS order_date,
order_id
FROM
ecommerce.ecomm_order_details
LIMIT 3;