RE: Question about case statement

2004-08-11 Thread Lachlan Mulcahy
Hi there, What you probably want is UPDATE temp SET QE = CASE WHEN QE = 1 THEN 6 END QF = CASE WHEN QF = 1 THEN 5 END WHERE QA = 1 AND (QE 6 OR QF 5) http://dev.mysql.com/doc/mysql/en/Control_flow_functions.html Lachlan -Original Message- From: Mo Li [mailto:[EMAIL

Re: Question about case statement

2004-08-11 Thread Michael Stassen
The original problem was that CASE returns the result corresponding to the matching condition. It isn't really a flow-control function. I don't think Lachlan's suggestion is right either, though. Its missing a comma, I think, but more importantly, it will set QE and QF to NULL whenever they