Re: [GENERAL] SELECT with REAL...

2006-02-07 Thread Philippe Ferreira
Hi, Thank you all for your comments. Finally, I think I will simply use the data type NUMERIC instead of REAL in all my columns !! This type is more appropriate to store prices ! Philippe Ferreira. Try this: SELECT 13.95 = 13.95::real; It should yield false, because the first number cons

Re: [GENERAL] SELECT with REAL...

2006-02-06 Thread Niklas Johansson
On 6 feb 2006, at 19.32, Philippe Ferreira wrote: I've just realized that this way, it works very fine : SELECT * FROM mytable WHERE myreal = 13.95::real; But I still don't understand very well why I need the explicit conversion (::real) ... Try this: SELECT 13.95 = 13.95::real; It sh

Re: [GENERAL] SELECT with REAL...

2006-02-06 Thread Steve Atkins
On Feb 6, 2006, at 10:21 AM, Philippe Ferreira wrote: Comparing two floating point numbers for equality seldom works the way you want it to. Without seeing the exact data you have it's hard to say for sure (as there may be some other issue with what you're doing) but I wouldn't expect th

Re: [GENERAL] SELECT with REAL...

2006-02-06 Thread Philippe Ferreira
Hi, I've just realized that this way, it works very fine : SELECT * FROM mytable WHERE myreal = 13.95::real; But I still don't understand very well why I need the explicit conversion (::real) ... Philippe Ferreira. ---(end of broadcast)--- T

Re: [GENERAL] SELECT with REAL...

2006-02-06 Thread Philippe Ferreira
Comparing two floating point numbers for equality seldom works the way you want it to. Without seeing the exact data you have it's hard to say for sure (as there may be some other issue with what you're doing) but I wouldn't expect this to work with data from arbitrary sources. Try SELEC

Re: [GENERAL] SELECT with REAL...

2006-02-05 Thread Steve Atkins
On Feb 5, 2006, at 2:30 PM, Philippe Ferreira wrote: Hi, I've never noticed before, but I don't manage to do a "SELECT" with conditions on REAL columns !! For example, the following command always returns 0 row, even if rows with myreal=10.5 do exist : SELECT * FROM mytable WHERE my

Re: [GENERAL] SELECT with REAL...

2006-02-05 Thread Michael Glaesemann
On Feb 6, 2006, at 7:30 , Philippe Ferreira wrote: For example, the following command always returns 0 row, even if rows with myreal=10.5 do exist : SELECT * FROM mytable WHERE myreal=10.5; Where am I wrong ?! Without seeing a more complete example, it's hard to say. It works for me

[GENERAL] SELECT with REAL...

2006-02-05 Thread Philippe Ferreira
Hi, I've never noticed before, but I don't manage to do a "SELECT" with conditions on REAL columns !! For example, the following command always returns 0 row, even if rows with myreal=10.5 do exist : SELECT * FROM mytable WHERE myreal=10.5; Where am I wrong ?! Thank you in advance, Phi