<div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 17, 2012 at 10:55 PM, Timothy Butler <span dir="ltr"><<a href="mailto:tbutler@ofb.biz" target="_blank">tbutler@ofb.biz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello, friends,<br>
        Let's say I have two columns in MySQL named body and extbody. Is there any easy way, entirely within a SQL query to take everything in extbody and append it to the existing body column for every row in the table? I've rethought the way I want to structure a MySQL table for a web app I've been working on and need to rapidly move the data around in four or five different installations, so doing so entirely in a self-contained query would make it a lot faster process...<br>
</blockquote></div><div class="gmail_extra"><br></div>Do you mean something like this?<div>UPDATE table SET body = CONCAT(COALESCE(body,''), COALESCE(extbody,''))<br></div><div class="gmail_extra"><br>If you want the extended text to start on the next line, it could be something like this:</div>
<div class="gmail_extra">UPDATE table SET body = CONCAT_WS(CHAR(10), COALESCE(body,''), COALESCE(extbody,''))</div><div><br></div>-- <br>Robert Wohlfarth<br><br>
</div>