- 事前にDECLAREで変数定義
DECLARE created_at TIMESTAMP;

-- 変数に値を設定
SET created_at = TIMESTAMP('2019-11-01 00:00:00');

SELECT
  FORMAT_DATE("%Y-%m", created_at) AS ym

◆実行結果

おすすめの記事