{"id":133,"date":"2013-04-05T16:20:55","date_gmt":"2013-04-05T16:20:55","guid":{"rendered":"http:\/\/ecodebook.wordpress.com\/?p=133"},"modified":"2013-04-05T16:20:55","modified_gmt":"2013-04-05T16:20:55","slug":"mysql-combine-two-columns-and-add-into-new-column","status":"publish","type":"post","link":"https:\/\/blog.mycarts.shop\/?p=133","title":{"rendered":"MySQL combine two columns and add into new column"},"content":{"rendered":"<h4>MySQL combine two columns and add into new column<\/h4>\n<p>[code language=&#8221;sql&#8221;]<br \/>\nUPDATE tablename SET combined = CONCAT(zipcode, &#8216; &#8211; &#8216;, city, &#8216;, &#8216;, state)<br \/>\n[\/code]<\/p>\n<p>Output: zipcode &#8211; city, state<\/p>\n<h4>MySQL combine two columns and add into new column where year is a number<\/h4>\n<p>[code language=&#8221;sql&#8221;]<br \/>\nUPDATE `tablename` SET cat_path = CONCAT(year, &#8216;\/&#8217;, name) WHERE concat(&#8221;,year * 1) = year<br \/>\n[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL combine two columns and add into new column [code language=&#8221;sql&#8221;] UPDATE tablename SET combined = CONCAT(zipcode, &#8216; &#8211; &#8216;, city, &#8216;, &#8216;, state) [\/code] Output: zipcode &#8211; city, state MySQL combine two columns and add into new column where year is a number [code language=&#8221;sql&#8221;] UPDATE `tablename` SET cat_path = CONCAT(year, &#8216;\/&#8217;, name) WHERE&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=133"}],"version-history":[{"count":0,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}