Skip site navigation (1) Skip section navigation (2)

Iterations in a SELECT

From: "Scott Muir" <wsmuir(at)islandnet(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Iterations in a SELECT
Date: 2001-07-18 02:07:33
Message-ID: NCBBKLMCJOGCLFHOFECNEECFDPAA.wsmuir@islandnet.com (view raw or flat)
Thread:
Lists: pgsql-novice
I have a small problem which I'm looking for an elegant solution to...

I'm trying to put together a select where a list dates is compared to a
period to identify dates which aren't in the list...

I could just create a list of days in a table (like 20 years worth) and then
compare it, but I'm wondering if there is a trick where one could get
results like this

select (for i := 1 to 5) as number;

or

select i as number from for(i,1,5);

and get something like

number
------
1
2
3
4
5

Any suggestions?
Thanks
Scott.


Responses

pgsql-novice by date

Next:From: Robby SlaughterDate: 2001-07-18 02:38:54
Subject: RE: Iterations in a SELECT
Previous:From: Tom LaneDate: 2001-07-17 20:42:25
Subject: Re: sequence primary key

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group