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

Re: Modifying selected records

From: Ruzsinszky Attila <ruzsinszky(dot)attila(at)gmail(dot)com>
To: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
Cc: postgresql novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Modifying selected records
Date: 2009-09-02 16:28:07
Message-ID: f637dd860909020928i272bd80dx293435872b3121b4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

Here is the whole stetement:

SELECT  COUNT(query2.*),
query1.all_kod,query1.nev,query1.megall,query1.erkezik_ido,query1.indul_ido
'910_'
|| COUNT(query2.*)
FROM (SELECT sorszam, all_kod, nev, megall, erkezik_ido, indul_ido,
train_selector
 FROM menetrend, stat  where statkod=all_kod and
train_selector in (SELECT train_selector
 FROM service where vonatszam='910' and datum_ig>now() and
datum_tol<now() order by datum_ig desc, datum_tol desc) order by
indul_ido) query1, (SELECT sorszam, all_kod, nev, megall, erkezik_ido,
indul_ido, train_selector
 FROM menetrend, stat  where statkod=all_kod and
train_selector in (SELECT train_selector
 FROM service where vonatszam='910' and datum_ig>now() and
datum_tol<now() order by datum_ig desc, datum_tol desc) order by
indul_ido) query2
WHERE query1.indul_ido >= query2.indul_ido GROUP BY query1.sorszam,
query1.all_kod, query1.nev, query1.megall, query1.erkezik_ido,
query1.indul_ido, query1.train_selector

The result is:
ERROR:  schema "query1" does not exist

I think I lost the thread ... this is too comlplex for me.

TIA,
Ruzsi

In response to

Responses

pgsql-novice by date

Next:From: Ruzsinszky AttilaDate: 2009-09-02 16:55:23
Subject: Re: Modifying selected records
Previous:From: Oliveiros C,Date: 2009-09-02 12:39:14
Subject: Re: Modifying selected records

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