Re: Problem with retrieving records using double precision fields

Поиск
Список
Период
Сортировка
От Raymond C. Rodgers
Тема Re: Problem with retrieving records using double precision fields
Дата
Msg-id 49775EF0.9060309@gmail.com
обсуждение исходный текст
Ответ на Re: Problem with retrieving records using double precision fields  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Richard Huxton wrote:
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)
 
Ok, so I made a simple math error (-83 being larger than -84) and didn't catch it.

Thanks,
Raymond

В списке pgsql-general по дате отправления:

Предыдущее
От: paulo matadr
Дата:
Сообщение: Res: [ADMIN] bytea size limit?
Следующее
От: Carlos Gonzalez-Cadenas
Дата:
Сообщение: deductive databases in postgreSQL