Open4
BigQueryのクエリあれこれ
変数定義みたいなのがしたい
ユーザー定義関数使う?
create temp function after_days(timestamp TIMESTAMP)
as (CURRENT_DATETIME());
SELECT
users.created_at,
after_days(users.created_at)
引数あり
create temp function after_days(timestamp TIMESTAMP)
as (CURRENT_DATETIME());
SELECT
users.created_at,
after_days(users.created_at)
timestampを日付けに
例, timestamp型のカラムのデータはそのまま渡せる
Date(users.created_at, "Asia/Tokyo"),
n日後
date_add(Date(users.created_at, "Asia/Tokyo"), INTERVAL 1 week),
with 複数並べるには?
with hoge as (
)
, hoge2 as (
)