Re: Question about a query with two count fields

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Question about a query with two count fields
Дата
Msg-id ED7CEE79-3174-428F-8708-E4B468C4728B@seespotcode.net
обсуждение исходный текст
Ответ на Re: Question about a query with two count fields  (David Fetter <david@fetter.org>)
Ответы Re: Question about a query with two count fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Sep 11, 2007, at 13:42 , David Fetter wrote:

> I believe that foo!=bar without white space should simply error out
> because there is no reasonable, unambiguous way to parse it.  Here's
> what we get right now:

What's ambigious about it? An operator cannot include a space, so !=
(no space) is *always* interpreted as one operator: not equals (<>).

space (! and = are separate operators), so ! is factorial.

> test=# SELECT (2! =0);
>  ?column?
> ----------
>  f
> (1 row)

> test=# SELECT (2 ! =0);
>  ?column?
> ----------
>  f
> (1 row)

> test=# SELECT (2 ! = 0);
>  ?column?
> ----------
>  f
> (1 row)
>

no space, so != is one operator,

> test=# SELECT (2!=0);
>  ?column?
> ----------
>  t
> (1 row)

> test=# SELECT (2 != 0);
>  ?column?
> ----------
>  t
> (1 row)
>

> test=# SELECT (2 !=0);
>  ?column?
> ----------
>  t
> (1 row)

Michael Glaesemann
grzm seespotcode net




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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: Question about a query with two count fields
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Question about a query with two count fields