[PgSQL 7.4.1] Problem with subquery

From: Edwin Pauli <edwin(at)epauli(dot)dyndns(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: [PgSQL 7.4.1] Problem with subquery
Date: 2004-02-26 17:16:29
Message-ID: 403E29ED.5010703@epauli.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Yesterday i had upgrade my PostgreSQL server from version 7.2.4
to 7.4.1.

There are troubles with a subquery after the upgrade.

Here is the query:

SELECT team_naam, team_id, wpim, (
SELECT count(thuis_uitslag)
FROM wedstrijden
WHERE (thuis_wed = t.team_id
OR uit_wed = t.team_id)
AND seizoen_id = 3 AND klasse_id = 1)
AS wd, (
SELECT count(t.team_id)
FROM wedstrijden w
WHERE (thuis_wed = t.team_id AND thuis_uitslag >
uit_uitslag OR uit_wed = t.team_id
AND thuis_uitslag < uit_uitslag)
AND seizoen_id = 3
AND klasse_id = 1 )
AS gw
FROM teams t
WHERE seizoen_id = 3 AND klasse_id = 1
GROUP BY t.team_naam, t.team_id, t.team_id, t.wpim

The SQL server returns:
-----------------------
SQL error:
ERROR: more than one row returned by a subquery used as an expression

This query works perfectly in PgSQL v7.2.4, but not in 7.4.1
Does anybody know what's wrong here?

--
Edwin Pauli

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2004-02-26 18:10:39 Re: PL/pgSQL debugger
Previous Message Keith Bottner 2004-02-26 16:58:02 Re: PL/pgSQL debugger