SQL conditional UPDATE
| From: | Derek Paterson | Date: | Thu, 12 Oct 2000 13:46:51 +0000 |
| Subject: | SQL conditional UPDATE | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3553@lists.php.net to get a copy of this message | ||
Is there any way within one SQL query to Update to different values
dependant on conditions. I've guessed at subqueries but cannot get my head
round the syntax and web advice differs dependant on source.
eg.
UPDATE table SET field1 = "valuea" WHERE condition1 ELSE field1 = "valueb"
I know I could build dynamic queries in PHP but this db isn't on the web
yet - trying to get it into shape to put it there.
TIA
Derek