Re: Using generate_series to create a unique ID in a query?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Sarah Dougherty <sdougherty(at)desc(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using generate_series to create a unique ID in a query?
Date: 2007-11-14 09:59:27
Message-ID: 20071114095926.GA5891@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 12, 2007 at 03:11:50PM -0800, Sarah Dougherty wrote:
> To recap with an example, the query below works fine, but how do I add a
> series to it?

generate_series will not help with this.
try the sequence approach, or this:
http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/

best regards,

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-11-14 10:36:16 Re: Client-requested cast mode to emulate Pg8.2 on v8.3
Previous Message Ow Mun Heng 2007-11-14 08:20:46 Re: Bulk Load Ignore/Skip Feature