SELECT
  -- start_time から end_time までの秒差分を取得
  TIMESTAMP_DIFF(TIMESTAMP(end_time), TIMESTAMP(start_time), SECOND) AS diff_second

  -- start_time から end_time までの分差分を取得
  TIMESTAMP_DIFF(TIMESTAMP(end_time), TIMESTAMP(start_time), MINUTE) AS diff_minute

  -- start_time から end_time までの時間差分を取得
  TIMESTAMP_DIFF(TIMESTAMP(end_time), TIMESTAMP(start_time), HOUR) AS diff_hour
FROM
  dataset.table
おすすめの記事