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

Reply via email to