Skip to content

Commit

Permalink
Add alternative date interval format
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Middleton committed Apr 25, 2012
1 parent 7762c69 commit db85f6f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/tips/dates.rst
Expand Up @@ -68,3 +68,11 @@ condition. Instead we can simply:
SELECT count(*)
FROM users
WHERE created_at >= (now() - '1 day'::INTERVAL);
An alternative syntax for this is available:

.. code-block:: sql
SELECT count(*)
FROM users
WHERE created_at >= (now() - interval '1 month');

0 comments on commit db85f6f

Please sign in to comment.