Re: != should give error?
От | Mikael Kjellström |
---|---|
Тема | Re: ! |
Дата | |
Msg-id | 846383b4-e690-97be-3ae7-43c7b00dd588@mksoft.nu обсуждение исходный текст |
Ответ на |
Re: ! |
Ответы |
Re: ! |
Список | 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 по дате отправления: