Re: SQL Date Challenge - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: SQL Date Challenge
Date
Msg-id Pine.LNX.4.30.0106042323430.768-100000@peter.localdomain
Whole thread Raw
In response to Re: SQL Date Challenge  ("Josh Berkus" <josh@agliodbs.com>)
Responses Re: SQL Date Challenge
Re: SQL Date Challenge
List pgsql-sql
Josh Berkus writes:

>     I am trying to list all Wednesdays that are *not* in column x.
>
>     This requires me to build a list of all possible Wednesdays (within a
> date range), preferably *without* first having a table of all dates in
> existance!  Some sort of manipulation of the date processor should be
> possible, shouldn't it?

You can't easily build data out of nothing in a declarative way in SQL.
Basically, if you want a list of data you either need to put them in a
table (which you don't want) or list them in the command itself (which you
can't).  This isn't made easier by the fact that functions currently can't
return sets without extreme wizardry.

Your problem is probably solved best if some of the computation is shifted
to the client side.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-sql by date:

Previous
From: Alex Pilosov
Date:
Subject: Re: SQL Date Challenge
Next
From: "Josh Berkus"
Date:
Subject: Re: SQL Date Challenge