SELECT 
  target_date
  , SUBSTR(target_date, 1, 4) AS y  -- target_dateを年に変換
  , SUBSTR(target_date, 1, 7) AS ym  -- target_dateを年月に変換
  , SUBSTR(target_date, 1, 10) AS ymd  -- target_dateを年月日に変換
FROM
  TABLE1
おすすめの記事