Merging (concatenating) two values from one table
Sql for merging two fields text content into one field on the same table:
update thetable as firstpart join thetable as secondpart on firstpart.id = secondpart.id
set firstpart.value = concat(firstpart.value, 'glue', secondpart.value)
where firstpart.condition = 1 and secondpart.condition = 2;
Written by sivaschenko
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sql
Authors
Related Tags
#sql
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#