Reputation: 2709
I want to copy the part of the content of column 'alttext' to 'direction' for those records where alttext contains the word 'blick'
UPDATE sv_gps SET direction = alttext WHERE alttext LIKE '%blick%'
so far, so good but I only want to copy the part of the string that begins with the word blick (and continues to the end). That is wehere I love your help.
e.g.
alttext:
Bergrestaurant und hotel Schonbuhel. Blick ins Glemmtal.
schould result in
direction:
Blick ins Glemmtal.
Upvotes: 1
Views: 511
Reputation: 204854
UPDATE sv_gps
SET direction = substring(alttext, instr(alttext, 'blick'))
WHERE alttext LIKE '%blick%'
Upvotes: 1