Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何确定一个月中有多少天,从第一天到当天(可能是一个月的任何地方)。因此,如果我有一个字段给出 6/01/12 5:32:13 PM 和 6/07/12 5:33:04 PM 我如何获得差异?
我认为应该这样做:
SELECT TRUNC(SYSDATE) - TRUNC(SYSDATE,'MONTH') + 1 FROM DUAL
SELECT EXTRACT(DAY FROM sysdate) FROM dual;