Search Postgresql Archives

Re: SELECT with REAL...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 here:
create table real_test
(
    real_label text primary key
    , real_value real not null unique
);

copy real_test (real_label, real_value) from stdin;
foo	1.2
bar	10.53
baz	10.5
bat	-54.3
\.


test=# select * from real_test;
real_label | real_value
------------+------------
foo        |        1.2
bar        |      10.53
baz        |       10.5
bat        |      -54.3
(4 rows)

test=# select * from real_test where real_value >= 10.5;
real_label | real_value
------------+------------
bar        |      10.53
baz        |       10.5
(2 rows)

test=# select * from real_test where real_value = 10.5;
real_label | real_value
------------+------------
baz        |       10.5
(1 row)

test=# select version();
version ------------------------------------------------------------------------ ---------------------------------------------------------------------- PostgreSQL 8.1.0 on powerpc-apple-darwin8.3.0, compiled by GCC powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc. build 5026)
(1 row)


Michael Glaesemann
grzm myrealbox com





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux