Re: UPDATE keyword

From: Rene Pijlman <rpijlman(at)spamcop(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE keyword
Date: 2001-05-29 16:38:29
Message-ID: soj7hts8fcsf26lp2ehojfk40bvc37fbli@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ianh(at)co(dot)pierce(dot)wa(dot)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(at)spamcop(dot)net>

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Barnard 2001-05-29 16:44:35 Re: Re: [SQL] Difficult SQL Statement
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-05-29 15:35:22 Re: Fresh Installation of 7.1.1 RPMs = no binding to a port