{"id":5441,"date":"2024-11-14T09:40:37","date_gmt":"2024-11-14T01:40:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5441\/"},"modified":"2024-11-14T09:40:37","modified_gmt":"2024-11-14T01:40:37","slug":"mysql%e5%a2%9e%e5%88%a0%e8%af%ad%e5%8f%a5%e6%80%8e%e4%b9%88%e5%86%99","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5441\/","title":{"rendered":"mysql\u589e\u5220\u8bed\u53e5\u600e\u4e48\u5199"},"content":{"rendered":"<blockquote><p>\n  \u589e\u5220\u64cd\u4f5c\u8bed\u6cd5\uff1a\u589e (insert)insert into \u6307\u5b9a\u8868\u540dvalues \u6307\u5b9a\u63d2\u5165\u7684\u503c\u5220 (delete)delete from \u6307\u5b9a\u8868\u540dwhere \u6307\u5b9a\u5220\u9664\u6761\u4ef6\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/28\/2024052813242421857.jpg\" class=\"aligncenter\" title=\"mysql\u589e\u5220\u8bed\u53e5\u600e\u4e48\u5199\u63d2\u56fe\" alt=\"mysql\u589e\u5220\u8bed\u53e5\u600e\u4e48\u5199\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u589e\u5220\u8bed\u53e5<\/strong><\/p>\n<p><strong>\u589e<\/strong><\/p>\n<p><strong>\u8bed\u6cd5\uff1a<\/strong><\/p>\n<pre>INSERT INTO \u8868\u540d (\u5217\u540d1, \u5217\u540d2, ...)\nVALUES (\u503c1, \u503c2, ...)<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4f8b\u5982\uff1a<\/strong><\/p>\n<pre>INSERT INTO employees (emp_id, name, salary)\nVALUES (101, 'John Doe', 50000);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u5220<\/strong><\/p>\n<p><strong>\u8bed\u6cd5\uff1a<\/strong><\/p>\n<pre>DELETE FROM \u8868\u540d\nWHERE \u6761\u4ef6<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4f8b\u5982\uff1a<\/strong><\/p>\n<pre>DELETE FROM employees\nWHERE emp_id = 101;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u8be6\u7ec6\u8bf4\u660e\uff1a<\/strong><\/p>\n<p><strong>\u589e<\/strong><\/p>\n<ul>\n<li>INSERT \u8bed\u53e5\u7528\u4e8e\u5728\u8868\u4e2d\u63d2\u5165\u65b0\u8bb0\u5f55\u3002<\/li>\n<li>INTO \u5173\u952e\u5b57\u6307\u5b9a\u8981\u63d2\u5165\u8bb0\u5f55\u7684\u8868\u540d\u3002<\/li>\n<li>VALUES \u5173\u952e\u5b57\u6307\u5b9a\u8981\u63d2\u5165\u7684\u503c\u3002<\/li>\n<li>\u5217\u540d\u5fc5\u987b\u4e0e\u8868\u4e2d\u7684\u5217\u987a\u5e8f\u76f8\u5339\u914d\u3002<\/li>\n<li>\u503c\u53ef\u4ee5\u662f\u6587\u5b57\u3001\u6570\u5b57\u6216\u5176\u4ed6\u8868\u8fbe\u5f0f\u3002<\/li>\n<\/ul>\n<p><strong>\u5220<\/strong><\/p>\n<ul>\n<li>DELETE \u8bed\u53e5\u7528\u4e8e\u4ece\u8868\u4e2d\u5220\u9664\u8bb0\u5f55\u3002<\/li>\n<li>FROM \u5173\u952e\u5b57\u6307\u5b9a\u8981\u5220\u9664\u8bb0\u5f55\u7684\u8868\u540d\u3002<\/li>\n<li>WHERE \u5b50\u53e5\u6307\u5b9a\u5220\u9664\u6761\u4ef6\u3002<\/li>\n<li>\u6761\u4ef6\u53ef\u4ee5\u662f\u4efb\u4f55\u5e03\u5c14\u8868\u8fbe\u5f0f\u3002<\/li>\n<li>\u5982\u679c\u6ca1\u6709\u6307\u5b9a WHERE \u5b50\u53e5\uff0c\u5c06\u5220\u9664\u8868\u4e2d\u7684\u6240\u6709\u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u589e\u5220\u8bed\u53e5\u600e\u4e48\u5199\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u589e\u5220\u64cd\u4f5c\u8bed\u6cd5\uff1a\u589e (insert)insert into \u6307\u5b9a\u8868\u540dvalues \u6307\u5b9a\u63d2\u5165\u7684\u503c\u5220 (delete)delete from \u6307\u5b9a\u8868\u540dwhere \u6307\u5b9a\u5220\u9664\u6761\u4ef6 MySQL \u589e\u5220\u8bed\u53e5 \u589e \u8bed\u6cd5\uff1a INSERT INTO \u8868\u540d (\u5217\u540d1, \u5217\u540d2, &#8230;) VALUES (\u503c1, \u503c2, &#8230;) \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a INSERT INTO employees (emp_id, name, salary) VALUES (101, &#8216;John Doe&#8217;, 50000); \u767b\u5f55\u540e\u590d\u5236 \u5220 \u8bed\u6cd5\uff1a DELETE FROM \u8868\u540d WHERE \u6761\u4ef6 \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a DELETE FROM employees WHERE emp_id = 101; \u767b\u5f55\u540e\u590d\u5236 \u8be6\u7ec6\u8bf4\u660e\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5441","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5441"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5441\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}