1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-09 10:08:01 +00:00

Add Intervals Of Time By Week as a postgres til.

This commit is contained in:
jbranchaud
2015-07-02 08:45:41 -05:00
parent b54a6bd807
commit 287316b506
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Intervals Of Time By Week
It is pretty common to use hours or days when creating a Postgres
interval. However, intervals can also be created in week-sized chunks
```sql
> select '2 weeks'::interval;
interval
----------
14 days
(1 row)
> select make_interval(0,0,7,0,0,0,0);
make_interval
---------------
49 days
(1 row)
```