-1

lets say I have table Book and columns are: color and name,

I want to update book's color to orange if name of that book is more than 5 characters long..of course update of every book in table like that...so any ideas ?sorry for bad English.

Kakarot
  • 43
  • 8
  • 2
    Welcome to Stackoverflow. You have provided a good explanation of the problem. However, you should also show your attempt at solving this. – Vamsi Prabhala Jan 10 '17 at 00:18
  • 1
    Possible duplicate of [Get column value length, not column max length of value](http://stackoverflow.com/questions/13064621/get-column-value-length-not-column-max-length-of-value) – Wolfgang Jan 10 '17 at 06:46

2 Answers2

1
update book set color = 'ORANGE' where length(name) > 5;

VKP is right, you should always show what you have tried. Here is your answer to your homework.

Brian Leach
  • 2,025
  • 1
  • 11
  • 14
1
Update Book
    Set Color = 'Orange'
    Where Length(name) > 5
Rajat Mishra
  • 3,635
  • 4
  • 27
  • 41