PG-SQL 随心记录
pgSQL 关于时间
- 时间 00:00
SELECT DISTINCT to_char(a,‘HH24:MI’) dd FROM generate_series(‘2020-06-01’::date,‘2020-06-01’::Date+ interval ‘1 day’, ‘1 hours’) as a order by dd;
- 天
SELECT to_char(a,‘yyyy-MM-dd’)::date fulldate
FROM generate_series(‘2020-06-01’::date,‘2020-06-01’::Date+ interval ‘1 month’, ‘1 days’) as a