Re: != should give error?

Поиск
Список
Период
Сортировка
От Mikael Kjellström
Тема Re: != should give error?
Дата
Msg-id 846383b4-e690-97be-3ae7-43c7b00dd588@mksoft.nu
обсуждение исходный текст
Ответ на Re: != should give error?  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: != should give error?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On 2017-12-21 08:16, Craig Ringer wrote:

>     postgres=# create table tbl (col_a int, col_b int);
>     CREATE TABLE
>     postgres=# insert into tbl values (1,2);
>     INSERT 0 1
>     postgres=# insert into tbl values (2,1);
>     INSERT 0 1
>     *postgres=# select * from tbl where col_a ! = 1;
>      col_a | col_b
>     -------+-------
>          1 |     2
>     (1 row)*
>     *
>     *
>
> One-factorial is one, so it's correct.

Yes, but I think he was expecting the behavior to be different from / 
not equal.  So he meant to write:

select * from tbl where col_a != 1;

I.e. col_a different from 1.

BTW isn't the "preferred" way of writing different from / not equal in 
SQL to use the <> operator?

/Mikael


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Using ProcSignal to get memory context stats from a running backend
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Parallel Hash take II