'postgreSQL첫번째날마지막날구하기'에 해당되는 글 1건

  1. 2023.03.13 postgreSQL 이번달의 첫번째날, 마지막날 구하기
PostgreSQL2023. 3. 13. 22:26

postgreSQL 이번달의 첫번째날, 마지막날 구하기

 

 

SELECT cast(date_trunc('month',current_date) as date) as firstday, 
(date_trunc('MONTH', current_date) + INTERVAL '1 MONTH - 1 day')::date lastday;

 

 

current_date를 활용한다.

Posted by 사슴영혼'-'