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.
hiredate(sysdate)とPL/SQLで呼び出される列の間の日数をカウントするにはどうすればよいですか。
hiredate
ありがとう。
次のことを試すことができます。
SELECT TRUNC(sysdate) - TRUNC(t.hiredate) FROM myTable t;
これにより、日数が10進数で表されます。タイムスタンプのTRUNCは、連続した呼び出しで一貫した結果が得られることを保証します。
TRUNC
select round((months_between(sysdate,hiredate) * 30),0) from table