Re: Modifying selected records

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

Well, one way to do it with just sql , AFAIK, at least, is
to use something like (untested)

SELECT COUNT(query2.*),
query1.all_kod,quey1.nev,query1.megall,query1.erkezik_ido,query1.indul_ido,'910_'
|| COUNT(query2.*)
FROM (/*your query goes here */) query1, (/*and here */) query2
WHERE query1.indul_ido >= query2.indul_ido

Try this out, then tell me if it worked

I'm Assuming that no two trains depart at the same time. Is this true?

Also, be aware that this is quite slow when the output becomes too extense,
and it is suitable only for small outputs.

Best,
Oliveiros

PS- Always include the mailing list in CC, as someone more knowledgeable
than me may help you faster and/or better

----- Original Message -----
From: "Ruzsinszky Attila" <ruzsinszky(dot)attila(at)gmail(dot)com>
To: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
Sent: Wednesday, September 02, 2009 11:41 AM
Subject: Re: [NOVICE] Modifying selected records

>> Does your output have any kind of order?
> Yes.
>
>> For ex, by the arrival/departure time of the train, or by registration
>> number or something?
> Now: order by indul_ido (means: departure time).
>
>> Is that a big listing? Or it produces just a few dozens records?
> I think no. The give example is 37 records. I think the maximum will be
> 100-150-200 records.
>
> Bye:
> Ruzsi

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ruzsinszky Attila 2009-09-02 12:10:36 Re: Modifying selected records
Previous Message Oliveiros C, 2009-09-02 10:37:38 Re: Modifying selected records