Formatting timestamps and dates
Timestamps can be confusing when viewed as text (e.g., '2020-06-02 23:57:12.120174 UTC'
), especially in a report format. Ensuring that your reports are easy to understand can be a factor in determining how your results are used.
Diese Übung ist Teil des Kurses
Introduction to BigQuery
Anleitung zur Übung
- Add the date formatting for the column
order_purchase_timestamp
in the'MM/DD/YY'
format using the%D
option.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
-- 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;