Re: SQL query

Поиск
Список
Период
Сортировка
От Ravi Krishna
Тема Re: SQL query
Дата
Msg-id trinity-ccf02f29-8fd9-417f-8b6d-f57a39426ebd-1555612815386@3c-app-mailcom-lxa14
обсуждение исходный текст
Ответ на Re: SQL query  ("Ravi Krishna" <srkrishna@myself.com>)
Список pgsql-general
Oh wait.  I see that it in both cases it did update correct target rows, but the value of col1 for non matching rows
is different. In the first case (and col2), the non matching rows also got updated.

So yes, same behavior like yours.


> Sent: Thursday, April 18, 2019 at 2:36 PM
> From: "Ravi Krishna" <srkrishna@myself.com>
> To: "Vikas Sharma" <shavikas@gmail.com>
> Cc: pgsql-general@lists.postgresql.org
> Subject: Re: SQL query
>
> Not able to produce this with PG 11.1
>
> If col1 is any type other than boolean, the update statement fails in syntax.
> If col1 is boolean, then it updated it correctly.  In other words
>    update col1 = NULL
>     and col2 in (1,2)
> is treated same as
>    update col1 = NULL
>      where col2 in (1,2)
>
> Also I checked it on DB2 which rejected the UPDATE sql as bad syntax, as expected.
>
>
>
>



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

Предыдущее
От: "Ravi Krishna"
Дата:
Сообщение: Re: SQL query
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: SQL query