> -----Original Message-----
> From: Thomas Sundberg > Sent: Friday, February 04, 2005 07:48
> To: mysql@lists.mysql.com
> 
> 
> > -----Original Message-----
> > From: Michael Stassen > > Sent: den 4 februari 2005 14:19
> > To: Thomas Sundberg
> > Cc: mysql@lists.mysql.com
> > 
> >  From the manual, "where_definition consists of the keyword 
> > WHERE followed by  an expression that indicates the condition 
> > or conditions that rows must satisfy to be selected." 
> > <http://dev.mysql.com/doc/mysql/en/select.html>
> > 
> > That seems simple and straightforward to me.  Perhaps if you 
> > told us why you need this, someone could provide you with the 
> > answer you need.
> 
> It is very simple but absolutely not straight forward. It 
> really doesn't say
> anything. Just that you should do things right and then you 
> will not have
> any problems.
> The concrete problem I tried to solve were if MySQL supports 
> xor in a where
> clause. And if so, how should the syntax be written? That

Yes, you can use XOR in the where clause.

SELECT * FROM mytable WHERE col1 XOR col2;

This is not a bitwise XOR, it evaluates each column to true or false first
then evals the XOR.

example for an int column:

a | b | eval
------------
0 | 0 | false
1 | 0 | true
1 | 1 | false
-1| 12| false 
12| 0 | true
 
> would have been
> extremely simple if the syntax diagram started just above the 
> quote you
> supplied us with had been completed and not ended when things 
> got a bit
> interesting.
> 
> /Thomas

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to