{"id":142361,"date":"2024-10-31T22:40:29","date_gmt":"2024-10-31T14:40:29","guid":{"rendered":"https:\/\/server.hk\/cnblog\/142361\/"},"modified":"2024-10-31T22:40:29","modified_gmt":"2024-10-31T14:40:29","slug":"sql2023-%e6%95%b8%e6%93%9a%e5%ba%ab%e4%bf%ae%e6%94%b9%e6%96%b9%e6%b3%95%e8%a9%b3%e8%a7%a3%ef%bc%88sql2023-%e4%bf%ae%e6%94%b9%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/142361\/","title":{"rendered":"SQL2023 \u6578\u64da\u5eab\u4fee\u6539\u65b9\u6cd5\u8a73\u89e3\uff08sql2023 \u4fee\u6539\u6578\u64da\u5eab\uff09"},"content":{"rendered":"<h1 id=\"sql2023-%e6%95%b8%e6%93%9a%e5%ba%ab%e4%bf%ae%e6%94%b9%e6%96%b9%e6%b3%95%e8%a9%b3%e8%a7%a3%ef%bc%88sql2023-%e4%bf%ae%e6%94%b9%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%89-RNJyhUPYKS\">SQL2023 \u6578\u64da\u5eab\u4fee\u6539\u65b9\u6cd5\u8a73\u89e3\uff08sql2023 \u4fee\u6539\u6578\u64da\u5eab\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u7ba1\u7406\u548c\u4fee\u6539\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002SQL\uff08\u7d50\u69cb\u5316\u67e5\u8a62\u8a9e\u8a00\uff09\u662f\u7528\u65bc\u8207\u6578\u64da\u5eab\u9032\u884c\u4ea4\u4e92\u7684\u4e3b\u8981\u8a9e\u8a00\u4e4b\u4e00\u3002\u96a8\u8457\u6280\u8853\u7684\u9032\u6b65\uff0cSQL2023\u7248\u672c\u5f15\u5165\u4e86\u4e00\u4e9b\u65b0\u7684\u529f\u80fd\u548c\u6700\u4f73\u5be6\u8e10\uff0c\u4f7f\u5f97\u6578\u64da\u5eab\u7684\u4fee\u6539\u66f4\u52a0\u9ad8\u6548\u548c\u5b89\u5168\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39SQL2023\u4e2d\u6578\u64da\u5eab\u7684\u4fee\u6539\u65b9\u6cd5\uff0c\u5305\u62ec\u57fa\u672c\u7684\u6578\u64da\u64cd\u4f5c\u8a9e\u53e5\u3001\u6700\u4f73\u5be6\u8e10\u4ee5\u53ca\u793a\u4f8b\u4ee3\u78bc\u3002<\/p>\n<h2 id=\"%e5%9f%ba%e6%9c%ac%e7%9a%84%e6%95%b8%e6%93%9a%e6%93%8d%e4%bd%9c%e8%aa%9e%e5%8f%a5-RNJyhUPYKS\">\u57fa\u672c\u7684\u6578\u64da\u64cd\u4f5c\u8a9e\u53e5<\/h2>\n<p>\u5728SQL\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4fee\u6539\u4e3b\u8981\u901a\u904e\u4ee5\u4e0b\u5e7e\u7a2e\u64cd\u4f5c\u8a9e\u53e5\u4f86\u5be6\u73fe\uff1a<\/p>\n<ul>\n<li><strong>INSERT<\/strong>\uff1a\u7528\u65bc\u5411\u6578\u64da\u5eab\u4e2d\u63d2\u5165\u65b0\u6578\u64da\u3002<\/li>\n<li><strong>UPDATE<\/strong>\uff1a\u7528\u65bc\u66f4\u65b0\u5df2\u5b58\u5728\u7684\u6578\u64da\u3002<\/li>\n<li><strong>DELETE<\/strong>\uff1a\u7528\u65bc\u522a\u9664\u6578\u64da\u5eab\u4e2d\u7684\u6578\u64da\u3002<\/li>\n<\/ul>\n<h3 id=\"1-insert-%e8%aa%9e%e5%8f%a5-RNJyhUPYKS\">1. INSERT \u8a9e\u53e5<\/h3>\n<p>INSERT\u8a9e\u53e5\u7528\u65bc\u5c07\u65b0\u8a18\u9304\u6dfb\u52a0\u5230\u6578\u64da\u8868\u4e2d\u3002\u4ee5\u4e0b\u662fINSERT\u8a9e\u53e5\u7684\u57fa\u672c\u8a9e\u6cd5\uff1a<\/p>\n<pre><code>INSERT INTO \u8868\u540d (\u52171, \u52172, \u52173) VALUES (\u503c1, \u503c2, \u503c3);<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5047\u8a2d\u6211\u5011\u6709\u4e00\u500b\u540d\u70ba\u201c\u7528\u6236\u201d\u7684\u8868\uff0c\u4e26\u5e0c\u671b\u63d2\u5165\u4e00\u500b\u65b0\u7528\u6236\u7684\u6578\u64da\uff1a<\/p>\n<pre><code>INSERT INTO \u7528\u6236 (\u59d3\u540d, \u5e74\u9f61, \u96fb\u5b50\u90f5\u4ef6) VALUES ('\u5f35\u4e09', 30, 'zhangsan@example.com');<\/code><\/pre>\n<h3 id=\"2-update-%e8%aa%9e%e5%8f%a5-RNJyhUPYKS\">2. UPDATE \u8a9e\u53e5<\/h3>\n<p>UPDATE\u8a9e\u53e5\u7528\u65bc\u4fee\u6539\u5df2\u5b58\u5728\u7684\u6578\u64da\u3002\u5176\u57fa\u672c\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>UPDATE \u8868\u540d SET \u52171 = \u503c1, \u52172 = \u503c2 WHERE \u689d\u4ef6;<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u6211\u5011\u60f3\u8981\u66f4\u65b0\u7528\u6236\u201c\u5f35\u4e09\u201d\u7684\u5e74\u9f61\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8a9e\u53e5\uff1a<\/p>\n<pre><code>UPDATE \u7528\u6236 SET \u5e74\u9f61 = 31 WHERE \u59d3\u540d = '\u5f35\u4e09';<\/code><\/pre>\n<h3 id=\"3-delete-%e8%aa%9e%e5%8f%a5-RNJyhUPYKS\">3. DELETE \u8a9e\u53e5<\/h3>\n<p>DELETE\u8a9e\u53e5\u7528\u65bc\u522a\u9664\u6578\u64da\u8868\u4e2d\u7684\u8a18\u9304\u3002\u5176\u57fa\u672c\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>DELETE FROM \u8868\u540d WHERE \u689d\u4ef6;<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u82e5\u8981\u522a\u9664\u7528\u6236\u201c\u5f35\u4e09\u201d\u7684\u8a18\u9304\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8a9e\u53e5\uff1a<\/p>\n<pre><code>DELETE FROM \u7528\u6236 WHERE \u59d3\u540d = '\u5f35\u4e09';<\/code><\/pre>\n<h2 id=\"%e6%9c%80%e4%bd%b3%e5%af%a6%e8%b8%90-RNJyhUPYKS\">\u6700\u4f73\u5be6\u8e10<\/h2>\n<p>\u5728\u9032\u884c\u6578\u64da\u5eab\u4fee\u6539\u6642\uff0c\u9075\u5faa\u4e00\u4e9b\u6700\u4f73\u5be6\u8e10\u53ef\u4ee5\u5e6b\u52a9\u63d0\u9ad8\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u5b8c\u6574\u6027\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u4e8b\u52d9<\/strong>\uff1a\u5728\u9032\u884c\u591a\u500b\u6578\u64da\u64cd\u4f5c\u6642\uff0c\u4f7f\u7528\u4e8b\u52d9\u53ef\u4ee5\u78ba\u4fdd\u64cd\u4f5c\u7684\u539f\u5b50\u6027\uff0c\u907f\u514d\u6578\u64da\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u3002<\/li>\n<li><strong>\u5099\u4efd\u6578\u64da<\/strong>\uff1a\u5728\u9032\u884c\u4efb\u4f55\u4fee\u6539\u4e4b\u524d\uff0c\u52d9\u5fc5\u5099\u4efd\u6578\u64da\uff0c\u4ee5\u9632\u6b62\u610f\u5916\u4e1f\u5931\u3002<\/li>\n<li><strong>\u4f7f\u7528\u689d\u4ef6\u8a9e\u53e5<\/strong>\uff1a\u5728UPDATE\u548cDELETE\u64cd\u4f5c\u4e2d\uff0c\u52d9\u5fc5\u4f7f\u7528WHERE\u689d\u4ef6\uff0c\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-RNJyhUPYKS\">\u7d50\u8ad6<\/h2>\n<p>SQL2023\u63d0\u4f9b\u4e86\u5f37\u5927\u7684\u6578\u64da\u5eab\u4fee\u6539\u529f\u80fd\uff0c\u901a\u904eINSERT\u3001UPDATE\u548cDELETE\u8a9e\u53e5\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u9748\u6d3b\u5730\u7ba1\u7406\u6578\u64da\u3002\u9075\u5faa\u6700\u4f73\u5be6\u8e10\u4e0d\u50c5\u80fd\u63d0\u9ad8\u6578\u64da\u7684\u5b89\u5168\u6027\uff0c\u9084\u80fd\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002\u96a8\u8457\u6280\u8853\u7684\u767c\u5c55\uff0c\u6301\u7e8c\u5b78\u7fd2\u548c\u9069\u61c9\u65b0\u7684\u6578\u64da\u5eab\u7ba1\u7406\u6280\u8853\u5c07\u662f\u6bcf\u4f4d\u958b\u767c\u8005\u7684\u91cd\u8981\u4efb\u52d9\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u6578\u64da\u5eab\u7ba1\u7406\u6709\u9032\u4e00\u6b65\u7684\u9700\u6c42\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u4f86\u63d0\u5347\u60a8\u7684\u6578\u64da\u8655\u7406\u80fd\u529b\uff0c\u7121\u8ad6\u662f\u642d\u5efa\u6578\u64da\u5eab\u9084\u662f\u9032\u884c\u6578\u64da\u5206\u6790\uff0c\u9078\u64c7\u5408\u9069\u7684\u670d\u52d9\u5668\u90fd\u80fd\u70ba\u60a8\u7684\u696d\u52d9\u589e\u6dfb\u52a9\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22SQL2023\u6578\u64da\u5eab\u4fee\u6539\u65b9\u6cd5\uff0c\u8a73\u7d30\u89e3\u8aaa\u5982\u4f55\u6709\u6548\u66f4\u65b0\u548c\u7ba1\u7406\u6578\u64da\u5eab\uff0c\u63d0\u5347\u6578\u64da\u64cd\u4f5c\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-142361","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/142361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=142361"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/142361\/revisions"}],"predecessor-version":[{"id":142362,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/142361\/revisions\/142362"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=142361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=142361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=142361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}