代码之家  ›  专栏  ›  技术社区  ›  dark horse

红移-显示表中存储的时间差的问题

  •  0
  • dark horse  · 技术社区  · 7 年前

    亚马逊红移

    瓦尔查尔

    order_no,order_date,complain_date,time_duration
    1001,2018-03-10 04:00:00,2018-03-11 07:00:00,97200000000
    

    当我将持续时间存储在表中,然后查询以查看输出时,就会发生此问题。

    谢谢。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Red Boy    7 年前

    按下面的方法做,会有时差 select datediff(hour,order_date,complain_date) as diff_in_hour from your_table ;

    select datediff(day,order_date,complain_date) as diff_in_day from your_table;

    datediff time_duration .

    Redshift documentation