{"id":865,"date":"2012-08-15T07:55:11","date_gmt":"2012-08-15T07:55:11","guid":{"rendered":"http:\/\/www.withinweb.com\/info\/?p=865"},"modified":"2012-09-20T08:10:42","modified_gmt":"2012-09-20T08:10:42","slug":"an-insert-into-with-other-calculations","status":"publish","type":"post","link":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/","title":{"rendered":"An INSERT INTO with other calculations"},"content":{"rendered":"<p>This mySQL &#8220;Insert from another table with select&#8221; example shows how you can concatenate two of the selected fields into one inserted field.<\/p>\n<p>In this example we are inserting data into tbllistings using data from tblrawdata but we are doing other processing on fields before it is inserted.\u00a0 Obviously you can use any of the other mySQL select string, arithmetic and mathematical operators and functions when you do your select statement and then insert those into the new table.<\/p>\n<blockquote><p>INSERT INTO tbllistings (<br \/>\nproperty_id,<br \/>\nagent_id,<br \/>\nproperty_address,<br \/>\nproperty_borough,<br \/>\n.. etc<br \/>\n)<br \/>\nSELECT<br \/>\nProp_ID,<br \/>\nconcat(property_id, agent_id),<br \/>\nprop_name,<br \/>\nprop_street,<br \/>\n.. etc<br \/>\nFROM tblrawdata;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>This mySQL &#8220;Insert from another table with select&#8221; example shows how you can concatenate two of the selected fields into one inserted field. In this example we are inserting data into tbllistings using data from tblrawdata but we are doing<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/\">Read more <span class=\"screen-reader-text\">An INSERT INTO with other calculations<\/span><span class=\"meta-nav\"> &#8250;<\/span><\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-865","post","type-post","status-publish","format-standard","hentry","category-sql_databases_and_queries"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>An INSERT INTO with other calculations - PHP Web Applications<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An INSERT INTO with other calculations - PHP Web Applications\" \/>\n<meta property=\"og:description\" content=\"This mySQL &#8220;Insert from another table with select&#8221; example shows how you can concatenate two of the selected fields into one inserted field. In this example we are inserting data into tbllistings using data from tblrawdata but we are doing&hellip;Read more An INSERT INTO with other calculations &#8250;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/\" \/>\n<meta property=\"og:site_name\" content=\"PHP Web Applications\" \/>\n<meta property=\"article:published_time\" content=\"2012-08-15T07:55:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-09-20T08:10:42+00:00\" \/>\n<meta name=\"author\" content=\"paulv\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"paulv\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/\"},\"author\":{\"name\":\"paulv\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\"},\"headline\":\"An INSERT INTO with other calculations\",\"datePublished\":\"2012-08-15T07:55:11+00:00\",\"dateModified\":\"2012-09-20T08:10:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/\"},\"wordCount\":112,\"commentCount\":0,\"articleSection\":[\"SQL databases\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/\",\"name\":\"An INSERT INTO with other calculations - PHP Web Applications\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\"},\"datePublished\":\"2012-08-15T07:55:11+00:00\",\"dateModified\":\"2012-09-20T08:10:42+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/an-insert-into-with-other-calculations\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"An INSERT INTO with other calculations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/\",\"name\":\"PHP Web Applications\",\"description\":\"Information and support for products of WithinWeb.com\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/#\\\/schema\\\/person\\\/04da5531c302d55ffcd777fe81dbb93c\",\"name\":\"paulv\",\"url\":\"https:\\\/\\\/www.withinweb.com\\\/info\\\/author\\\/paulv\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"An INSERT INTO with other calculations - PHP Web Applications","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/","og_locale":"en_US","og_type":"article","og_title":"An INSERT INTO with other calculations - PHP Web Applications","og_description":"This mySQL &#8220;Insert from another table with select&#8221; example shows how you can concatenate two of the selected fields into one inserted field. In this example we are inserting data into tbllistings using data from tblrawdata but we are doing&hellip;Read more An INSERT INTO with other calculations &#8250;","og_url":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/","og_site_name":"PHP Web Applications","article_published_time":"2012-08-15T07:55:11+00:00","article_modified_time":"2012-09-20T08:10:42+00:00","author":"paulv","twitter_card":"summary_large_image","twitter_misc":{"Written by":"paulv","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/#article","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/"},"author":{"name":"paulv","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c"},"headline":"An INSERT INTO with other calculations","datePublished":"2012-08-15T07:55:11+00:00","dateModified":"2012-09-20T08:10:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/"},"wordCount":112,"commentCount":0,"articleSection":["SQL databases"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/","url":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/","name":"An INSERT INTO with other calculations - PHP Web Applications","isPartOf":{"@id":"https:\/\/www.withinweb.com\/info\/#website"},"datePublished":"2012-08-15T07:55:11+00:00","dateModified":"2012-09-20T08:10:42+00:00","author":{"@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c"},"breadcrumb":{"@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.withinweb.com\/info\/an-insert-into-with-other-calculations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.withinweb.com\/info\/"},{"@type":"ListItem","position":2,"name":"An INSERT INTO with other calculations"}]},{"@type":"WebSite","@id":"https:\/\/www.withinweb.com\/info\/#website","url":"https:\/\/www.withinweb.com\/info\/","name":"PHP Web Applications","description":"Information and support for products of WithinWeb.com","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.withinweb.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.withinweb.com\/info\/#\/schema\/person\/04da5531c302d55ffcd777fe81dbb93c","name":"paulv","url":"https:\/\/www.withinweb.com\/info\/author\/paulv\/"}]}},"_links":{"self":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/comments?post=865"}],"version-history":[{"count":3,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/865\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/posts\/865\/revisions\/893"}],"wp:attachment":[{"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/media?parent=865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/categories?post=865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withinweb.com\/info\/wp-json\/wp\/v2\/tags?post=865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}