Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Well, one way to do it with just sql , AFAIK, at least, is
to use something like (untested)

SELECT  COUNT(query2.*), 
|| 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.


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


pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group