SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- https://pgexercises.com/questions/date/endtimes.html |
| 1 | + | -- https://pgexercises.com/questions/date/bookingspermonth.html |
| 2 | - | select starttime, starttime + slots*('30 minutes'::INTERVAL) as endtime
|
| 2 | + | -- again, date_trunc works, date_part does not |
| 3 | -- not surprisingly, as they solve different problems | |
| 4 | - | order by 2 desc, 1 desc |
| 4 | + | |
| 5 | - | limit 10 |
| 5 | + | select date_trunc('month',starttime) as month,
|
| 6 | count(starttime) | |
| 7 | from cd.bookings | |
| 8 | group by 1 | |
| 9 | order by 1 asc |