Re: SQL query

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: SQL query
Date: 2019-04-18 17:58:49
Message-ID: 771509b6-9002-99c5-8e23-8e4164bc8c4a@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/18/19 11:43 AM, Vikas Sharma wrote:
> Hi,
>
> I have come across a query that a developer wrote to update a few rows in
> table, the query did update the two desired rows but also updated the
> rest of the table with the column value as 'false'.
>
> Update tableA set col1 = null and col2 in (1,2);
>
> The query updated col1 to null for the rows where col2 was either 1 or 2,
> rest of rows were also updated for col1 to 'false'.
>  The above was run without where clause.

On the QA server, right?

--
Angular momentum makes the world go 'round.

In response to

  • SQL query at 2019-04-18 16:43:41 from Vikas Sharma

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-04-18 18:29:11 Re: ERROR: operator class "gin__int_ops" does not exist for access method "gin"
Previous Message Michel Pelletier 2019-04-18 17:52:43 Re: Method to pass data between queries in a multi-statement transaction