我正在尝试这个 sql。
select a.id,b.d_date,a.bp_date,DATEDIFF('day',now()-b.d_date) from imp a inner join dp b
on a.id = b.id where a.bp_date is null
但它给了我空值。
答案 0 :(得分:0)
这有效:
select current_date - '2020-12-30 16:19:29.712000'::date;
?column?
----------
180
(1 row)