{"id":15416,"date":"2023-12-04T20:04:17","date_gmt":"2023-12-04T12:04:17","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15416"},"modified":"2023-12-04T20:04:56","modified_gmt":"2023-12-04T12:04:56","slug":"oracle-zhong-delete-yu-truncate-de-qu-bie","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-delete-yu-truncate-de-qu-bie\/","title":{"rendered":"Oracle \u4e2d delete \u4e0e truncate \u7684\u533a\u522b\uff1f"},"content":{"rendered":"<p><code>DELETE<\/code> \u548c <code>TRUNCATE<\/code> \u90fd\u662f\u5220\u9664\u8868\u4e2d\u7684\u6570\u636e\uff0c\u4f46\u6709\u51e0\u4e2a\u91cd\u8981\u7684\u533a\u522b\uff1a<\/p>\n<ol>\n<li>\n<strong>\u64cd\u4f5c\u65b9\u5f0f<\/strong>\uff1a<\/p>\n<ul>\n<li><code>DELETE<\/code> \u662f\u4e00\u79cd DML\uff08Data Manipulation Language\uff09\u8bed\u53e5\uff0c\u5b83\u4ee5\u884c\u4e3a\u5355\u4f4d\u5220\u9664\u6570\u636e\uff0c\u5e76\u53ef\u4ee5\u5e26\u6709 WHERE \u5b50\u53e5\u4ee5\u6ee1\u8db3\u7279\u5b9a\u6761\u4ef6\u3002<\/li>\n<li><code>TRUNCATE<\/code> \u662f\u4e00\u79cd DDL\uff08Data Definition Language\uff09\u8bed\u53e5\uff0c\u5b83\u4ee5\u5feb\u901f\u3001\u9ad8\u6548\u7684\u65b9\u5f0f\u4e00\u6b21\u6027\u5220\u9664\u6574\u4e2a\u8868\u7684\u6570\u636e\uff0c\u4e0d\u5141\u8bb8\u5e26\u6709 WHERE \u5b50\u53e5\uff0c\u800c\u4e14\u5220\u9664\u64cd\u4f5c\u662f\u4e0d\u53ef\u56de\u6eda\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u4e8b\u52a1\u4e0e\u65e5\u5fd7<\/strong>\uff1a<\/p>\n<ul>\n<li><code>DELETE<\/code> \u64cd\u4f5c\u662f\u53ef\u56de\u6eda\u7684\uff0c\u5b83\u4f1a\u5728\u4e8b\u52a1\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u88ab\u5220\u9664\u7684\u884c\uff0c\u53ef\u4ee5\u901a\u8fc7\u56de\u6eda\u64cd\u4f5c\u6765\u64a4\u9500\u5220\u9664\u3002<\/li>\n<li><code>TRUNCATE<\/code> \u64cd\u4f5c\u4e0d\u4ec5\u5220\u9664\u6570\u636e\uff0c\u8fd8\u4f1a\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\u5e76\u5c06\u5176\u5f52\u8fd8\u7ed9\u8868\u7a7a\u95f4\uff0c\u4f46\u4e0d\u8bb0\u5f55\u5728\u4e8b\u52a1\u65e5\u5fd7\u4e2d\uff0c\u56e0\u6b64\u4e0d\u53ef\u56de\u6eda\u3002\u8fd9\u4f7f\u5f97 <code>TRUNCATE<\/code> \u6bd4 <code>DELETE<\/code> \u66f4\u5feb\uff0c\u4f46\u662f\u4e0d\u53ef\u6062\u590d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u6743\u9650<\/strong>\uff1a<\/p>\n<ul>\n<li><code>DELETE<\/code> \u53ea\u8981\u5bf9\u8868\u6709\u5220\u9664\u6743\u9650\u5c31\u53ef\u4ee5\u6267\u884c\u3002<\/li>\n<li><code>TRUNCATE<\/code> \u9700\u8981\u66f4\u9ad8\u7ea7\u522b\u7684\u6743\u9650\uff0c\u6bd4\u5982\u901a\u5e38\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u6216\u8005\u8868\u7a7a\u95f4\u7684\u6240\u6709\u8005\u6743\u9650\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u5728\u4f7f\u7528\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u8003\u8651\u9700\u8981\u7684\u64cd\u4f5c\u548c\u5bf9\u6570\u636e\u7684\u5f71\u54cd\uff0c\u9009\u62e9\u9002\u5408\u7684\u65b9\u6cd5\u3002\u5982\u679c\u9700\u8981\u7cbe\u786e\u63a7\u5236\u5220\u9664\u7684\u8303\u56f4\u6216\u8005\u9700\u8981\u53ef\u4ee5\u56de\u6eda\u7684\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>DELETE<\/code>\uff1b\u5982\u679c\u9700\u8981\u5feb\u901f\u5220\u9664\u6574\u4e2a\u8868\u7684\u6570\u636e\u5e76\u91ca\u653e\u7a7a\u95f4\uff0c\u800c\u4e14\u4e0d\u9700\u8981\u56de\u6eda\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>TRUNCATE<\/code>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DELETE \u548c TRUNCATE \u90fd\u662f\u5220\u9664\u8868\u4e2d\u7684\u6570\u636e\uff0c\u4f46\u6709\u51e0\u4e2a\u91cd\u8981\u7684\u533a\u522b\uff1a \u64cd\u4f5c\u65b9\u5f0f\uff1a DELETE \u662f\u4e00\u79cd [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15416","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15416"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15416\/revisions"}],"predecessor-version":[{"id":15417,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15416\/revisions\/15417"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15416"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}