Averaging dates in oracle sql

后端 未结 4 1667
逝去的感伤
逝去的感伤 2020-12-10 07:06

Is there a way to average multiple dates in oracle? avg doesn\'t do any good.

Thanks.

4条回答
  •  醉酒成梦
    2020-12-10 07:27

    SYSDATE + AVG( dt - SYSDATE )

    No need to convert a date to a date. Truncate entire expression if you don't want the time included in result. Truncate the date column (dt) if you don't want times to be used in the computation of the average. MEDIAN is not the same as AVG.

提交回复
热议问题