Duration column 

Use a string formatted value to upsert a duration value into a column.

Use a string formatted value to upsert a duration value into a column.
Note: Express values for duration without quotes.

Formatting duration values 

Express duration in ISO 8601 format:
NyNmoNwNdNhNsNmsNusNns
Where :
  • y: years
  • mo: months
  • w: weeks
  • d: days
  • h: hours
  • m: minutes
  • s: seconds
  • ms: milliseconds
  • µs or us: microseconds
  • ns: nanoseconds

For example, 2mo10d12h for 2 months 10 days and 12 hours. Missing designators are set to 0.

Procedure

  • INSERT duration values.
    INSERT INTO cycling.race_times (
       finish_time,
       race_name, cyclist_name, race_date)
    VALUES (
       1h4m48s20ms,
       '17th Santos Tour Down Under', 'Rohan DENNIS', '2017-04-14');
  • UPDATE duration values.
    UPDATE cycling.race_times
      SET finish_time = 1h4m48s20ms
    WHERE race_name = '17th Santos Tour Down Under'
      AND cyclist_name = 'Rohan DENNIS'
      AND race_date = '2017-04-14';