Re: SQL query

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ravi Krishna <srkrishna(at)myself(dot)com>, Vikas Sharma <shavikas(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: SQL query
Date: 2019-04-18 18:41:16
Message-ID: e66f60fe-05f7-8e34-eeec-777f497c6b24@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/18/19 11:36 AM, Ravi Krishna wrote:
> 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)

The above is not the same format as OP's query:

Update tableA set col1 = null and col2 in (1,2);
>
> Also I checked it on DB2 which rejected the UPDATE sql as bad syntax, as expected.
>
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2019-04-18 19:12:43 Re: SQL query
Previous Message Ravi Krishna 2019-04-18 18:40:15 Re: SQL query