Re: Modifying selected records

From: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Ruzsinszky Attila" <ruzsinszky(dot)attila(at)gmail(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Modifying selected records
Date: 2009-09-02 09:46:06
Message-ID: 0F0746C647CC4333ABED74CAB533CEBA@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Howdy, Ruzsi.

What do u mean by "recount the sorszam continously from 0 to 34" ?

The sorszam is only allowed to take values on that range? Is That ?

Best,
Oliveiros

----- Original Message -----
From: "Ruzsinszky Attila" <ruzsinszky(dot)attila(at)gmail(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, September 02, 2009 9:42 AM
Subject: [NOVICE] Modifying selected records

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ruzsinszky Attila 2009-09-02 09:55:15 Re: Modifying selected records
Previous Message Ruzsinszky Attila 2009-09-02 08:42:43 Modifying selected records