Re: Update with a Repeating Sequence

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Update with a Repeating Sequence
Date: 2008-10-14 19:23:52
Message-ID: CB8BCEA5-E9BD-443B-8128-E11FB91EDF5C@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Oct 14, 2008, at 11:36 AM, Bill Thoen wrote:

> The table exists already; all I need to do is update the sequence
> code to make the records unique, but also I need each repeating set
> numbered from 0 (Zero) so I can select a list of unique farm field
> records where seq = 0.

"select distinct on (field_id) * from table;" should let you do that,
without requiring the repeating set stuff.

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vladimir Dzhuvinov 2008-10-14 19:45:52 Re: PL/pgSQL stored procedure returning multiple result sets (SELECTs)?
Previous Message Steve Crawford 2008-10-14 19:18:55 Re: databases list to file