dbTalk Databases Forums  

Q: Update with Case when

comp.databases.postgresql comp.databases.postgresql


Discuss Q: Update with Case when in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ralf Bender
 
Posts: n/a

Default Q: Update with Case when - 07-14-2008 , 07:32 AM






Hello Everybody!

I'm trying to update a table with the following update statement, but
always getting a syntax error:
UPDATE object4
CASE WHEN (position( ',' in feld4)-1) > 0 THEN SET
feld3=substring(feld4 from 1 for position( ',' in feld4)-1)
ELSE feld3=feld4
END
WHERE feld3 like 'DIVERSE%%'


Could someone help ....

Thanks
Ralf

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.