Re: UPDATE keyword - Mailing list pgsql-general

From Rene Pijlman
Subject Re: UPDATE keyword
Date
Msg-id soj7hts8fcsf26lp2ehojfk40bvc37fbli@4ax.com
Whole thread Raw
In response to Re: UPDATE keyword  ("Ian Harding" <ianh@co.pierce.wa.us>)
List pgsql-general
ianh@co.pierce.wa.us ("Ian Harding") schreef:
>True, true... but the next time I need the code to fire I would
>need ot remember that I had set it to 1 and set it to something else...

False, false, I've thought of that :-)

The statement says:

    dummy = 1 - dummy

a) Initially, dummy == 0. Then dummy becomes 1 - 0 which equals 1.

b) So dummy == 1. Then dummy becomes 1 - 1 which equals 0.

c) Goto a.

Dummy changes value from 0->1 or 1->0 on every execution of the
statement.

If you don't believe it, you can also try dummy = -dummy, but then you
have to remember to initialize it to a non-zero value :-)

--
Vriendelijke groet,
René Pijlman <rpijlman@spamcop.net>

Wat wil jij leren?
http://www.leren.nl/

pgsql-general by date:

Previous
From: "Jose-Manuel Lorenzo-Lopez"
Date:
Subject: About multiple access to a table
Next
From: Jonathan Bartlett
Date:
Subject: Re: Something odd with Postgresql 6.5