我需要进行一个将显示以下内容的 sql 查询:
'截至当前日期超过 90 天的活跃帐户总数'
日期来自一个 sql 查询,它是这样的:
select date from currentdatetable
现在我的查询是计算来自 accounttable 的所有活动帐户,所以我的查询如下所示:
select count(*) from accountstable
我的问题是如何声明 accounttable 中的日期比 currentdatetable 的日期早 90 天?
我当前的代码:
select count(*) from accountstable at where at.date > (select date from currentdatetable)