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.
「2010-10-26」と「2010-08-23」という2つの列があり、間隔を日数で取得したいのですが、選択クエリでこれを行う最良の方法は何ですか30,31,29,28日の月?すでにこれを行う機能はありますか?
ありがとうございました。
それらがすでに日付形式になっている場合は、非常に簡単です。
SELECT '10/26/2010'::date - '08/23/2010'::date;
また:
SELECT date '2001-10-01' - date '2001-09-28'; // outputs integer 3