Re: [General] Unable to identify an operator '=' for types 'numeric' and 'double precision' You will have to retype this query using and explicit cast
В списке pgsql-general по дате отправления:
| От | Edmund Lim Chi Chung |
|---|---|
| Тема | Re: [General] Unable to identify an operator '=' for types 'numeric' and 'double precision' You will have to retype this query using and explicit cast |
| Дата | |
| Msg-id | 1015894694.3c8d52a6927d6@www.swopt.com обсуждение исходный текст |
| Ответ на | [General] Unable to identify an operator '=' for types 'numeric' and 'double precision' You will have to retype this query using and explicit cast (Edmund Lim Chi Chung <edmund@swopt.com>) |
| Список | pgsql-general |
引言 Andrew Sullivan <andrew@libertyrms.info>:
> On Mon, Mar 11, 2002 at 11:45:07AM +0800, Edmund Lim Chi Chung wrote:
> >
> > CREATE TABLE testdecimal ( decimal_value DECIMAL(6,2));
> > INSERT INTO testdecimal VALUES(1.0);
> > INSERT INTO testdecimal VALUES(1.1);
> > SELECT * FROM testdecimal WHERE decimal_value = 1.0;
> >
> > Error : Unable to identify an operator '=' for types 'numeric' and
> 'double
> > precision'
> > You will have to retype this query using and explicit cast
>
> You'll need to recast, like it says. Try
>
> SELECT * FROM testdecimal WHERE decimal_value = 1.0::decimal;
>
> A
>
> --
> ----
> Andrew Sullivan 87 Mowat Avenue
> Liberty RMS Toronto, Ontario Canada
> <andrew@libertyrms.info> M6K 3E3
> +1 416 646 3304 x110
>
>
Found two more method:
SELECT * FROM testdecimal WHERE decimal_value = '1.0';
SELECT * FROM testdecimal WHERE decimal_value = CAST( 1.0 AS decimal );
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера