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

Re: BUG #2714: Wrong Result with static number

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Frank Schmidt" <schmidt(at)dozent(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2714: Wrong Result with static number
Date: 2006-10-26 17:11:03
Message-ID: 22154.1161882663@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Frank Schmidt" <schmidt(at)dozent(dot)net> writes:
> 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 don't think you're showing us what you actually typed, because that
"as decimal(8,2)" isn't valid syntax.  But probably the real issue is
that you've got some NULL entries in Bestelldetails.  An ALL test
cannot succeed (return TRUE) if there are null rows.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Stefan KaltenbrunnerDate: 2006-10-26 17:13:54
Subject: Re: BUG #2721: configuration issue
Previous:From: Bruce MomjianDate: 2006-10-26 17:07:48
Subject: Re: BUG #2722: DBD::Pg v1.49 quoting generate warning

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