Re: Generate a dynamic sequence within a query - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Generate a dynamic sequence within a query
Date
Msg-id 4CBF6D02.1050709@iol.ie
Whole thread Raw
In response to Generate a dynamic sequence within a query  (David Kerr <dmk@mr-paradox.net>)
Responses Re: Generate a dynamic sequence within a query
Re: Generate a dynamic sequence within a query
List pgsql-general
On 20/10/2010 23:22, David Kerr wrote:
> I know I've seen posts on how to do this, but i can't seem to find them.
>
> I've got a data set
>
> A, B
> A, C
> A, D
> [...]
>
> and so on
>
> and i'd like to be able to wite a query that would result in
>
> 1,A,B
> 2,A,C
> 3,A,D
> [...]
>
> PG version is 8.3.
>
> Any ideas?

You probably want generate_series():

    http://www.postgresql.org/docs/8.3/static/functions-srf.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: David Kerr
Date:
Subject: Generate a dynamic sequence within a query
Next
From: David Kerr
Date:
Subject: Re: Generate a dynamic sequence within a query