More postgres is awesome
- Matt: harold, postgres - say I wanted to find all users where the time in days between their created_at and updated_at was 14 days
- Matt: I dont need the query, but point me at a function or something if you can
- Harold: easy peasy
- Harold: i'd use age() and interval
- Harold: so something like this:
- Harold: (code talks)
- Harold: select * from users where age(updated_at, created_at) < interval('14 days')
Short URL for this post: http://tmblr.co/ZPG7Sy1_o-As