Modifying selected records

From: Ruzsinszky Attila <ruzsinszky(dot)attila(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Modifying selected records
Date: 2009-09-02 08:42:43
Message-ID: f637dd860909020142l7d1dea89s5ac79d200fe500a8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I've got a subselect which output is this:

sorszam(int);all_kod(varchar);nev(varchar);megall(int);erkezik_ido(time);indul_ido(time);train_selector(varchar)
0;"5510017";"Budapest-Keleti pu.";1;"06:10:00";"06:10:00";"910_365334"
...
21;"5501289";"Győr";1;"07:39:00";"07:39:00";"910_365334"
0;"5501289";"Győr";1;"07:41:00";"07:41:00";"910_311546"
...
5;"5544800";"Csorna";1;"08:00:00";"08:00:00";"910_311546"
0;"5544800";"Csorna";1;"08:12:00";"08:12:00";"910_365339"
...
8;"5502246";"Szombathely";1;"09:02:00";"09:02:00";"910_365339"

I would like this:
...
x;"5501289";"Győr";1;"07:39:00";"07:41:00";"910_xxxxxx"
...
y;"5544800";"Csorna";1;"08:00:00";"08:12:00";"910_yyyyyy"
...

and I'd like recount the sorszam continously from 0 to 34.

Can I do this with SQL or I need PL/pgPerl, for example?

TIA,
Ruzsi

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Oliveiros C, 2009-09-02 09:46:06 Re: Modifying selected records
Previous Message Victor Jason 2009-09-02 06:41:14 Backup aggregate function