[EMAIL PROTECTED] wrote:
Why do you want to use a switch in this particular instance.  You're
comparing apples and oranges (in this case, col_1 and col_2).  You use
swithc to evaluate one variable against a number of choice, not multiple
variables against variable choices.


I'm not comparing apples and oranges - just have such a "case", but looks
like I'm wrong about using switch() on wrong place. Just thought it could
do it.
:)


What you're saying in that case is either col_1 evaluates to value1 or col_2 evaluates to value2. Unless you have some program logic to prevent both from being true, you are comparing apples and oranges. And any time col_1, evaluates to true, the "break" keyword will stop your switch ladder. Remove break, and that won't happen. of course, if you do that, then the question arises about why you are using a switch ladder in the first place.

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

Reply via email to