格式化時間戳記與日期
當時間戳記以文字呈現時(例如:'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;