Re: exclusive OR possible within a where clause?
| От | David Salisbury |
|---|---|
| Тема | Re: exclusive OR possible within a where clause? |
| Дата | |
| Msg-id | 4E9C84B0.6010509@globe.gov обсуждение исходный текст |
| Ответ на | Re: exclusive OR possible within a where clause? (John R Pierce <pierce@hogranch.com>) |
| Ответы |
Re: exclusive OR possible within a where clause?
Re: exclusive OR possible within a where clause? |
| Список | pgsql-general |
On 10/17/11 1:19 PM, John R Pierce wrote:
> On 10/17/11 12:15 PM, David Salisbury wrote:
>> <> is the same as !=, which is
>> different than the fabled XOR I was hoping for. In fact
>> they would never equal.
>
> F != F -> false
> F != T -> true
> T != F -> true
> T != T -> false
>
>
> how is that different than XOR, assuming the arguments are booleans ?
>
>
Perhaps what I'm hoping to do got munged. In essence it's equivalent of..
create table test ( something numeric );
insert into test values ( 1 );
insert into test values ( 2 );
select * from test where ( something = 1.5 + .5 ) or ( something = 1.5 - .5 );
something
-----------
1
2
(2 rows)
select * from test where ( something = 1.5 + .5 ) <> ( something = 1.5 - .5 );
something
-----------
1
2
(2 rows)
( which is of course equivalent of where something = 1 or something = 2 )
In my fabled XOR, I'd get the first one it matched, say something = 1, and the
something = 2 would then be ignored/dropped.
Dave
В списке pgsql-general по дате отправления: