select
to_char(/*B0*/TO_DATE('2024-07-01 00:00:00','YYYY-MM-DD HH24:MI:SS')/*E0*/ +
level - 1,
'yyyy-mm-dd') as 开始日期,
to_char(/*B0*/TO_DATE('2024-07-01 00:00:00','YYYY-MM-DD HH24:MI:SS')/*E0*/ +
level,
'yyyy-mm-dd') as 结束日期
from dual
connect by level <=
/*B1*/TO_DATE('2024-07-31 23:59:59','YYYY-MM-DD HH24:MI:SS')/*E1*/ -
/*B0*/TO_DATE('2024-07-01 00:00:00','YYYY-MM-DD HH24:MI:SS')/*E0*/ + 1
) C
where A.主页ID>0
and nvl(A.出院日期,sysdate)>to_date(C.开始日期,'YYYY-MM-DD')
and A.入院日期<to_date(C.结束日期,'YYYY-MM-DD')
group by C.开始日期
order by C.开始日期
每天住院人数
2024-10-17 20:32:48
上一篇:《惊封》经典语录