Re: UPDATE with AND clarification

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Jamie Thompson <jthompson(dot)neuk(at)gmail(dot)com>
Cc: "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: UPDATE with AND clarification
Date: 2024-03-22 13:35:22
Message-ID: CAKFQuwbrQUPOPhPQbor2=Fhi73bZPm-PYa4aV9oCERZD8SqwLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Friday, March 22, 2024, Jamie Thompson <jthompson(dot)neuk(at)gmail(dot)com> wrote:

>
> Earlier today, I was running some sql for someone which they had submitted
> as:
> > UPDATE tablename SET col1 = val1 AND col2 = val2 WHERE id = X
>

I presume these columns are booleans. So you wrote something like:
Set col1 = ( true and false = true )

Which in this case must coincidentally have produced whatever boolean value
already existed in col1.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bindra Bambharoliya 2024-03-22 16:50:04 Cursor with hold for select takes too long
Previous Message David G. Johnston 2024-03-22 13:28:42 Re: How to choose table in SELECT clause without schema qualifier or 'set local'