Search Postgresql Archives

Re: Problem with retrieving records using double precision fields

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

 



Raymond C. Rodgers wrote:
> In two separate databases that are configured to have latitude and
> longitude as double precision fields, I'm having trouble retrieving
> records using "between" on the longitude field. I know that I have data
> within range, but any query involving the longitude field fails to find
> records.

> test=# select * from coordtest where longitude between -83.0 and -84.0;

Order of between arguments is important.

richardh=> SELECT 2 between 1 and 3;
 ?column?
----------
 t
(1 row)

richardh=> SELECT 2 between 3 and 1;
 ?column?
----------
 f
(1 row)

richardh=> SELECT -2 between -1 and -3;
 ?column?
----------
 f
(1 row)

-- 
  Richard Huxton
  Archonet Ltd

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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