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

BUG #2714: Wrong Result with static number

From: "Frank Schmidt" <schmidt(at)dozent(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2714: Wrong Result with static number
Date: 2006-10-24 08:46:24
Message-ID: 200610240846.k9O8kOl7068702@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2714
Logged by:          Frank Schmidt
Email address:      schmidt(at)dozent(dot)net
PostgreSQL version: 8.1.5
Operating system:   Windows
Description:        Wrong Result with static number
Details: 

Follow skript works fine:

SELECT DISTINCT Artikelname, cast(BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2)) AS Preis, Rabatt
FROM Artikel A1, Bestelldetails BD1
WHERE A1.ArtikelNr = BD1.ArtikelNr
AND BD1.Einzelpreis * (1 - Rabatt) as decimal(8,2))>= ALL (SELECT
Einzelpreis * (1 - Rabatt) as decimal(8,2))
  FROM Bestelldetails);

But when I change the Statement "BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2))>= " to a static number (like 5) no result will be generated.

SELECT DISTINCT Artikelname, cast(BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2)) AS Preis, Rabatt
FROM Artikel A1, Bestelldetails BD1
WHERE A1.ArtikelNr = BD1.ArtikelNr
AND 5 >= ALL (SELECT Einzelpreis * (1 - Rabatt) as decimal(8,2))
  FROM Bestelldetails);

I can change the value to anything (real existing data), but nothing
happend. 

Whats wrong?

Responses

pgsql-bugs by date

Next:From: Thomas H.Date: 2006-10-24 13:15:52
Subject: Re: could not rename xlog (was: BUG #2712)
Previous:From: Magnus HaganderDate: 2006-10-24 06:05:28
Subject: Re: BUG #2712: could not fsync segment: Permission

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