dbTalk Databases Forums  

[BUGS] BUG #2714: Wrong Result with static number

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2714: Wrong Result with static number in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank Schmidt
 
Posts: n/a

Default [BUGS] BUG #2714: Wrong Result with static number - 10-26-2006 , 11:54 AM







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?

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2714: Wrong Result with static number - 10-26-2006 , 12:25 PM






"Frank Schmidt" <schmidt (AT) dozent (DOT) net> writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.