{"id":605,"date":"2021-04-01T17:34:19","date_gmt":"2021-04-01T12:04:19","guid":{"rendered":"https:\/\/selfimagination.in\/tips\/?p=605"},"modified":"2021-04-01T17:36:14","modified_gmt":"2021-04-01T12:06:14","slug":"mysql-update","status":"publish","type":"post","link":"https:\/\/selfimagination.in\/tips\/mysql-update\/","title":{"rendered":"MySQL Update (DML Statement) Detail With Example"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 \u092a\u0947\u091c \u0939\u092e MySQL Update \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u091c\u093e\u0928\u0947\u0902\u0917\u0947 <\/p>\n\n\n\n<p><strong>UPDATE &lt;TABLE> SET &lt;COLUMNS LIST> WHERE &lt;WHERE CLAUSE><\/strong>\u00a0(\u0921\u093e\u091f\u093e \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u0915\u094b \u092c\u0926\u0932\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u0907\u0938 Command \u0938\u0947 \u0939\u092e\u0928\u0947 \u091c\u094b \u0921\u093e\u091f\u093e Insert \u0915\u093f\u092f\u093e \u0925\u093e \u0909\u0938\u0915\u0940 Value \u092e\u0947\u0902 \u092c\u0926\u0932\u093e\u0935 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 <\/li><li>Update \u0915\u0947 \u0938\u093e\u0925 \u0939\u092e\u0947\u0936\u093e Whare \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u093e \u091a\u093e\u0939\u093f\u090f <\/li><li>\u092f\u0926\u093f Update \u092e\u0947\u0902 Where \u092e\u0947\u0902 Primary Key \u0915\u0947 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0947\u0902\u0917\u0947 \u0924\u094b \u0905\u092a\u0921\u0947\u091f Fast \u0939\u094b\u0917\u093e <\/li><li>Update \u092e\u0947\u0902 \u0939\u092e \u090f\u0915 \u0938\u0947 \u091c\u094d\u092f\u093e\u0926\u093e Colums \u0915\u093e \u092d\u0940 \u0909\u092a\u092f\u094b\u0917 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 <\/li><li>Update \u092e\u0947\u0902 Table \u092e\u0947\u0902 \u0939\u092e \u090f\u0915 \u0938\u0947 \u0905\u0927\u093f\u0915 Tables \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u092d\u0940 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902  \u0932\u0947\u0915\u093f\u0928 Update \u090f\u0915 \u0939\u0940 \u091f\u0947\u092c\u0932 \u0915\u094b \u0915\u0930\u0928\u093e \u091a\u093e\u0939\u093f\u090f <\/li><\/ul>\n\n\n\n<p><strong>\u0907\u0938 \u0915\u092e\u093e\u0902\u0921 \u0915\u094b \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0938\u092e\u092f \u0939\u092e\u0947\u0902 \u0927\u094d\u092f\u093e\u0928 \u0930\u0916\u0928\u093e \u091a\u093e\u0939\u093f\u090f \u0915\u0940 \u0939\u092e\u0947\u0902 \u092a\u094d\u0930\u0949\u092a\u0930 Where \u0932\u0917\u093e\u092f\u093e \u092f\u093e \u0928\u0939\u0940\u0902, \u0915\u094d\u092f\u0941\u0915\u0940 \u092f\u0926\u093f \u0939\u092e\u0928\u0947 \u092c\u093f\u0928\u093e Where \u0915\u0947 Execute \u0915\u0930 \u0926\u093f\u092f\u093e \u0924\u094b \u0938\u092d\u0940 \u0921\u093e\u091f\u093e \u092e\u0947\u0902 \u090f\u0915 \u0938\u093e\u0925 \u091a\u0947\u0902\u091c \u0906 \u091c\u093e\u092f\u0947\u0902\u0917\u0947<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL Update Query<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">UPDATE mytable\nSET column1 = 'VALUE'\nWHERE column1 = '??'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL Update Multiple Columns<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 Example \u092e\u0947\u0902 \u0939\u092e\u0928\u0947 \u090f\u0915 \u0938\u0947 \u091c\u094d\u092f\u093e\u0926\u093e Columns \u0915\u094b \u0905\u092a\u0921\u0947\u091f \u0915\u0930\u0915\u0947 \u092c\u0924\u093e\u092f\u093e \u0939\u0948\u0902 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">UPDATE mytable\nSET column1 = 'VALUE',\u00a0 \u00a0column2\u00a0\u00a0= 'VALUE'\nWHERE column1 = '??'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL Update Multiple Tables<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 Example \u092e\u0947\u0902 \u0939\u092e\u0928\u0947 \u0926\u094b Tables \u0915\u094b \u0932\u093f\u0902\u0915 \u0915\u0930\u0915\u0947 \u090f\u0915 Table \u0915\u0947 Columns \u0915\u094b \u0905\u092a\u0921\u0947\u091f \u0915\u093f\u092f\u093e \u0939\u0948 , \u0938\u093e\u0925 \u0939\u0940 \u092e\u0947\u0902 \u0939\u092e\u0928\u0947 Table2 \u0938\u0947 \u092d\u0940 \u090f\u0915 Column \u0915\u0940 Value Table1 \u092e\u0947\u0902 \u0905\u092a\u0921\u0947\u091f \u0915\u0940 \u0939\u0948\u0902 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">UPDATE mytable1 a, mytable2 b\nSET a.column1 = 'VALUE',\u00a0 \u00a0a.column2\u00a0\u00a0= b.column2\nWHERE a.key = b.key and b.column1 = '??'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u090f\u0915 \u0938\u0947 \u091c\u094d\u092f\u093e\u0926\u093e \u091f\u0947\u092c\u0932 \u0939\u094b\u0928\u0947 \u0915\u0947 \u0915\u093e\u0930\u0923 \u0939\u092e\u0928\u0947 \u092f\u0939\u093e\u0901 \u092a\u0930 Alias \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u093f\u092f\u093e \u0939\u0948\u0902 \u092f\u093e\u0928\u093f \u0915\u0940 mytable1 a \u0910\u0938\u093e \u0932\u093f\u0916\u0928\u0947 \u0938\u0947 mytable1 \u0915\u0940 \u091c\u0917\u0939 \u0939\u092e a \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 \u0910\u0938\u093e \u0915\u0930\u0928\u0947 \u0938\u0947 code \u091b\u094b\u091f\u0947 \u0930\u0939\u0924\u0947 \u0939\u0948\u0902 \u0914\u0930 \u0938\u092e\u091d\u0928\u0947 \u092e\u0947\u0902 \u092d\u0940 \u0906\u0938\u093e\u0928\u0940 \u0939\u094b\u0924\u0940 \u0939\u0948\u0902 \u0964 \u0914\u0930 \u092f\u0926\u093f \u091f\u0947\u092c\u0932 \u092e\u0947\u0902 \u0915\u0949\u0932\u092e \u0915\u0947 \u0928\u093e\u092e \u090f\u0915 \u091c\u0948\u0938\u0947 \u0939\u094b \u0917\u090f \u0924\u094b Alias \u0915\u0947 \u0909\u092a\u092f\u094b\u0917 \u0938\u0947 \u0935\u0939 Unique \u0939\u094b \u091c\u093e\u0924\u0947 \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u0948\u0938\u093e \u092a\u094d\u0930\u094b\u0917\u094d\u0930\u093e\u092e \u0939\u094b\u0924\u093e \u0939\u0948\u0902 \u0909\u0938\u0915\u0947 \u0905\u0928\u0941\u0938\u093e\u0930 Update \u0932\u093f\u0916\u0928\u093e \u0939\u094b\u0924\u0940 \u0939\u0948\u0902 , \u0938\u092d\u0940 \u0924\u0930\u0939 \u0915\u0947 Example \u0924\u094b \u092f\u0939\u093e\u0901 \u092a\u0930 \u0928\u0939\u0940\u0902 \u092c\u0924\u093e \u0938\u0915\u0924\u0947, \u0907\u0938\u092e\u0947\u0902 \u090f\u0915 \u0939\u093f\u0902\u091f \u0939\u0948\u0902 \u0907\u0938\u0915\u0947 \u0905\u0928\u0941\u0938\u093e\u0930 \u0906\u092a Update Query \u0932\u093f\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.sl.SQL_Logic\" target=\"_blank\" rel=\"noopener\">MySQL Logic \u090f\u0902\u0921\u094d\u0930\u093e\u0907\u0921 \u090f\u092a\u094d\u092a \u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u092f\u0939\u093e\u0901 \u0915\u094d\u0932\u093f\u0915 \u0915\u0930\u0947<\/a><\/li><li><a href=\"https:\/\/selfimagination.in\/tips\/mysql-tutorial-basic-n-advance\/\">MySQL Basic &amp; Advance \u0915\u0947 \u0932\u093f\u090f \u092a\u0922\u093c\u0947<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 \u092a\u0947\u091c \u092a\u0930 \u0939\u092e\u0928\u0947 MySQL Update \u0938\u0947 \u0938\u092e\u094d\u092c\u0902\u0927\u093f\u0924 Single Column Update&lt; Multi Columns \u0905\u092a\u0921\u0947\u091f, \u0938\u093f\u0902\u0917\u0932 \u091f\u0947\u092c\u0932 Update&lt; Multi Table Update \u0906\u0926\u093f \u0915\u0947 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u0938\u0940\u0916\u093e, \u0906\u0936\u093e \u0939\u0948\u0902 \u0915\u0940 \u0906\u092a\u0915\u094b \u0938\u092e\u091d \u092e\u0947\u0902 \u0906\u092f\u093e \u0939\u094b\u0917\u093e \u092f\u0926\u093f \u0915\u0939\u0940 \u092a\u0930 \u0915\u0941\u091b \u092d\u0940 \u0938\u092e\u091d \u0928\u0939\u0940\u0902 \u0906\u092f\u093e \u0939\u094b \u0924\u094b \u0906\u092a Comment \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 , \u0915\u0940\u092e\u0924\u0940 \u0938\u092e\u092f \u0926\u0947\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0927\u0928\u094d\u092f\u0935\u093e\u0926\u094d  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE &lt;TABLE> SET &lt;COLUMNS LIST> WHERE &lt;WHERE CLAUSE>\u00a0(\u0921\u093e\u091f\u093e \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 \u0915\u094b \u092c\u0926\u0932\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f) \u0907\u0938 Command \u0938\u0947 \u0939\u092e\u0928\u0947 \u091c\u094b \u0921\u093e\u091f\u093e Insert \u0915\u093f\u092f\u093e \u0925\u093e \u0909\u0938\u0915\u0940 Value \u092e\u0947\u0902 \u092c\u0926\u0932\u093e\u0935 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 Update \u0915\u0947 \u0938\u093e\u0925 \u0939\u092e\u0947\u0936\u093e Whare \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0928\u093e \u091a\u093e\u0939\u093f\u090f \u092f\u0926\u093f Update \u092e\u0947\u0902 Where \u092e\u0947\u0902 Primary Key \u0915\u0947 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0947\u0902\u0917\u0947 \u0924\u094b \u0905\u092a\u0921\u0947\u091f Fast \u0939\u094b\u0917\u093e Update [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":786,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-605","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/04\/mysql-update.jpg?fit=1200%2C628&ssl=1","_links":{"self":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/comments?post=605"}],"version-history":[{"count":11,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/605\/revisions\/787"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media\/786"}],"wp:attachment":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media?parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/categories?post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/tags?post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}