Re: DATE SQL - Mailing list pgsql-jdbc

From Mark Lewis
Subject Re: DATE SQL
Date
Msg-id 1141664650.17684.143.camel@archimedes
Whole thread Raw
In response to DATE SQL  ("wanpeng" <wanp2005@gmail.com>)
List pgsql-jdbc
Well, in pure SQL I don't think you could do it without resorting to
ugly tricks like defining an all_days table that had one row per day in
your range, then doing something like, "select from all_days a join xxx
x where a.day >= x.start_date and a.day <= x.end_date"

So . . . don't do that.  What you want isn't really a pure relational
operation, so SQL isn't the right language for it.  Either do it in your
application code, or write a server-side function.

In either case, this is more of a pgsql-general question, since it's not
specific to JDBC at all.

-- Mark Lewis


On Mon, 2006-03-06 at 18:39 +0800, wanpeng wrote:
> I want a result like
>
> '2006-03-01'
> '2006-03-02'
> '2006-03-03'
> '2006-03-04'
>
>
> FROM table xxx
>
> ……| start_date   |   end_date   |……
>     | '2006-03-01' |  '2006-03-04'|
>
> how can I write the sql
>
> thanks
>
> -----------------------------------------------
>                          wanp2005@gmail.com
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: JDBC support for 8.1 OUT parameters
Next
From: David Fetter
Date:
Subject: Re: DATE SQL