Skip to content

Instantly share code, notes, and snippets.

View artworkad's full-sized avatar
🎯
Focusing

Artjom Zabelin artworkad

🎯
Focusing
View GitHub Profile
#standardSQL
WITH `project.dataset.table` AS (
SELECT 1 customer_id, -500 value,
DATE '2019-10-12' timestamp UNION ALL
SELECT 1, -300, '2019-10-11' UNION ALL
SELECT 1, -200, '2019-10-10' UNION ALL
SELECT 2, 200, '2019-09-10' UNION ALL
SELECT 2, 100, '2019-08-10' UNION ALL
SELECT 2, 50, '2019-07-10' UNION ALL
SELECT 1, 600, '2019-09-02'