Re: Numbering rows - Mailing list pgsql-general

From Richard Broersma
Subject Re: Numbering rows
Date
Msg-id 396486430810151242x65da9f1dq1b376b20fdb00d2d@mail.gmail.com
Whole thread Raw
In response to Re: Numbering rows  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general
On Wed, Oct 15, 2008 at 12:32 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

> Can't you put the query into a subselect with an offset 0 and join to
> that to get the generate_series to work correctly?


I've never heard of doing it that way, but I'm very interestes in
seeing how it is done.  This is what i've tried so far, but am still
getting the cross join:

postgres=#
select * from generate_series(1,3)
CROSS JOIN  ( values('a'),('b'),('c') ) as myvals( letter )
OFFSET 0;

 generate_series | letter
-----------------+--------
               1 | a
               2 | a
               3 | a
               1 | b
               2 | b
               3 | b
               1 | c
               2 | c
               3 | c
(9 rows)


--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

pgsql-general by date:

Previous
From: Michele Petrazzo - Unipex srl
Date:
Subject: No select permission on a table but can query it
Next
From: "Scott Marlowe"
Date:
Subject: Re: No select permission on a table but can query it