5 ms·
I never understood the need for a datediff function. In Postgres (or Oracle) you just subtract two timestamps and use the resulting interval. It's a different a
by castorp 5y ago
I never understood the need for a datediff function. In Postgres (or Oracle) you just subtract two timestamps and use the resulting interval. It's a different approach to the same problem.
- michael-ax 5y agoone is counting distance, the other one buckets. alias the fn name to datebucketdelta to make the different problems memorable individually. :)
- castorp 5y agoWell for "counting buckets" you can use `date_bin()` since Postgres 14 which groups the difference between timestamps into defined intervals.