[H-GEN] Mysql & bitwise xor

Arjen Lentz arjen at mysql.com
Mon Nov 17 20:55:16 EST 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

Hi Paul,

On Mon, 2003-11-17 at 19:07, Paul Clarke wrote:
> Thanks for the info re this. It would seem that there are a lot of
> version 3.xx's out there are standard builds. My home box is a Debian
> build, and I presume that I installed mysql using apt-get install and
> requesting version 3. My server on rackshack also is installed with
> version 3 (so there is not much point upgrading my development box).

There can be, see my reply to Greg about chosing versions.
4.0 has been production for a long time now, and I do believe it's
available via apt-get....


> So, the next question is what is the logic needed to do an xor using
> only &, |, and ~ (and, or, and not)? Or will it be easier to do the
> calculation in php and writhing the result back?

The MySQL manual says:
  a XOR b
is mathematically equal to
  (a AND (NOT b)) OR ((NOT a) and b)

All in neat SQL ;-)


Regards,
Arjen.
-- 
Arjen Lentz, Technical Writer, Trainer
Brisbane, QLD Australia
MySQL AB, www.mysql.com

Melbourne 1 Dec 2003 (5 days): Using & Managing MySQL Training
Training,Support,Licenses,T-shirts @ https://order.mysql.com/?marl



--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list