[postgis-users] query error when combining UPDATE, CASE and WHERE

zhang zhe luckyclare at hotmail.com
Fri Dec 31 09:23:27 PST 2010


Hello,

 

I try to update one column value based the other two column values´s conditions. This code works



select book, case when table1.price>200 and table1.price<400 then '40'else book end from table 1 where table1.catalog='112'; 

 

Now I want to update the table1, so the book value will change into 40 when the other two conditions are true. 

 

update book, case when table1.price>200 and table1.price<400 then '40' else book end from table 1 where table1.catalog='112';

 

It gives error. Can anyone help me? 

 

Thanks

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101231/79587747/attachment.html>


More information about the postgis-users mailing list