Reference document for running time range queries in SQL

Strategies:

  1. Using Time Interval
  2. Using Start and/or End Dates
  3. Using EXTRACT()
  4. Using DATE_PART
SELECT *
FROM <table>
WHERE reference_date >= now() - INTERVAL '30 days'

INTERVAL might be used with days, seconds, hours, etc.

INTERVAL '1000 seconds'
INTERVAL '30 minutes'
INTERVAL '72 hours'
INTERVAL…