July 15, 2016 at 12:15 pm
Hi-
Table TEST
id width Lengh
1 0.0 20.0
2 2.3 1.00
3 0.0 23.0
4 1.9 11.0
I would like to update field "Width" with data in "Length" when Width = 0 and Lengh >0
then I also want to reset the lengh to blank after that, can you please advise how to do this.
What I have so far is
UPDATE TEST
SET width = lengh
SET lengh = '' ----Is is okay to do this?
where width = 0 and length > 0
Thanks.
Dee
July 15, 2016 at 12:18 pm
You use a comma to separate the columns in a set. Assuming the length field is numeric you will have to set it to 0 or null depending on the column properties
UPDATE TEST
SET width = length
,length = 0
where width = 0 and length > 0
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy