FW: "=" operator vs. "IS"

Поиск
Список
Период
Сортировка
От Dmitri Bichko
Тема FW: "=" operator vs. "IS"
Дата
Msg-id 7A4ADADFC8AFF0478D47F63BEDD57CE33A320C@gpmail.gphq.genpathpharma.com
обсуждение исходный текст
Ответы Re: FW: "=" operator vs. "IS"
Re: FW: "=" operator vs. "IS"
Re: FW: "=" operator vs. "IS"
Список pgsql-sql
You are exactly right - the way I think about it is that if you have two
values which are unknown (a null column and NULL) it does not follow
that they are equal to each other.

As far as TRUE and FALSE go, from what I know you can use = to compare
them with boolean columns, unless I misunderstood your question.

Dmitri

-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Stefan Weiss
Sent: Monday, June 28, 2004 6:02 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] "=" operator vs. "IS"


Hi.

I'm just curious - why is it not possible to use the "=" operator to
compare values with NULL? I suspect that the SQL standard specified it
that way, but I can't see any ambiguity in an expression like "AND
foo.bar = NULL". Is it because NULL does not "equal" any value, and the
expression should be read as "foo.bar is unknown"? Or is there something
else I'm missing?

If it's the "unknown" part, then why can't I use "=" to compare with
TRUE or FALSE?


cheers,
stefan

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


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

Предыдущее
От: Stefan Weiss
Дата:
Сообщение: "=" operator vs. "IS"
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: "=" operator vs. "IS"