日期相减,求天数
方法一:
select trunc(sysdate-cast(createdate as date)),createdate from goods t
cast 是可以将timestamp 转化为Date 类型。
方法二 :
利用隐士转化,直接将timestamp+0.
select trunc(sysdate-(createdate+0)),createdate from goods t