【发布时间】:2018-09-08 05:40:22
【问题描述】:
我正在处理一个要显示即将到来的日期数量的查询。即使有大于当前日期的日期,以下查询也会返回 0。请帮我解决这个问题。
SELECT (case when b.booked_date > cast(now() as date) then sum(1) else sum(0) end) as upcoming_booked_facilities
from svk_apt_book_facilities b
where b.customer_id = 1
and b.association_id = 1
and b.is_active = 1
group by b.facility_id
【问题讨论】: