要截取PGSQL DATE的部分信息,可以使用以下函數:
SELECT EXTRACT(year FROM your_date_column) AS year,
EXTRACT(month FROM your_date_column) AS month,
EXTRACT(day FROM your_date_column) AS day
FROM your_table;
SELECT DATE_PART('year', your_date_column) AS year,
DATE_PART('month', your_date_column) AS month,
DATE_PART('day', your_date_column) AS day
FROM your_table;
通過使用以上函數,可以方便地從PGSQL DATE中截取需要的部分信息。