MySQL Forums
Forum List  »  Newbie

Re: Moving Value from One Column to Another if first character is $
Posted by: Peter Brawley
Date: July 14, 2014 02:54PM

Incomplete spec. You need to specify which if any existing `bail` values are to be overwritten, and what is to happen to existing `10_percent` values.

Assuming the requirement is to overwrite existing `bail` values and remove existing `10_percent` values you are moving, and assuming the columns are strings ...

update tbl set `bail`=`10_percent`,`10_percent=''
where left('10_percent`,1)='$';

Options: ReplyQuote


Subject
Written By
Posted
Re: Moving Value from One Column to Another if first character is $
July 14, 2014 02:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.