select CURRENT_DATE + i
from generate_series(date '2012-06-29'- CURRENT_DATE,
date '2012-07-03' - CURRENT_DATE ) i
or even shorter:
select i::date from generate_series('2012-06-29',
'2012-07-03', '1 day'::interval) i
More Related Contents:
- How do you do date math that ignores the year?
- PostgreSQL: how to convert from Unix epoch to date?
- Check whether string is a date Postgresql
- How to compare dates in datetime fields in Postgresql?
- Postgresql query between date ranges
- Getting results between two dates in PostgreSQL
- Query for count of distinct values in a rolling date range
- Current date in Oracle Db
- Select rows which are not present in other table
- Optimize GROUP BY query to retrieve latest row per user
- How to implement a many-to-many relationship in PostgreSQL?
- Check if value exists in Postgres array
- How to use ANY instead of IN in a WHERE clause?
- Is there a shortcut for SELECT * FROM?
- sql statement error: “column .. does not exist”
- What is the difference between single quotes and double quotes in PostgreSQL?
- Constraint defined DEFERRABLE INITIALLY IMMEDIATE is still DEFERRED?
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- Best way to count rows by arbitrary time intervals
- Sorting null values after all others, except special
- Reference alias in WHERE clause
- Discard millisecond part from timestamp
- How do I cast a string to integer and have 0 in case of error in the cast with PostgreSQL?
- Comparing with date in Oracle sql
- SQL column reference “id” is ambiguous
- IN Clause with NULL or IS NULL
- postgres – where in (list) – column does not exist
- incomplete information from query on pg_views [duplicate]
- Subtracting Dates in Oracle – Number or Interval Datatype?
- PostgreSQL – dynamic value as table name [duplicate]