{"id":219,"date":"2011-03-02T10:47:43","date_gmt":"2011-03-02T02:47:43","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=219"},"modified":"2013-12-30T13:58:57","modified_gmt":"2013-12-30T05:58:57","slug":"%e4%bd%bf%e7%94%a8top%e9%99%90%e5%88%b6%e5%88%a0%e9%99%a4%e7%9a%84%e8%a1%8c","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=219","title":{"rendered":"\u4f7f\u7528TOP\u9650\u5236\u5220\u9664\u7684\u884c"},"content":{"rendered":"<p style=\"color: #333333; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\" style=\"color: black;\">\u53ef\u4ee5\u4f7f\u7528<\/span><span lang=\"en-US\" style=\"color: black;\">\u00a0TOP\u00a0<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u5b50\u53e5\u9650\u5236<\/span><span lang=\"en-US\" style=\"color: black;\">\u00a0DELETE\u00a0<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u8bed\u53e5\u4e2d\u5220\u9664\u7684\u884c\u6570<\/span><span lang=\"en-US\" style=\"color: black;\">.<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u5f53<\/span><span lang=\"en-US\" style=\"color: black;\">\u00a0TOP (<\/span><span lang=\"en-US\" style=\"font-style: italic; color: black;\">n<\/span><span lang=\"en-US\" style=\"color: black;\">)\u00a0<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u5b50\u53e5\u4e0e<\/span><span lang=\"en-US\" style=\"color: black;\">\u00a0DELETE\u00a0<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u4e00\u8d77\u4f7f\u7528\u65f6<\/span><span lang=\"en-US\" style=\"color: black;\">,<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u5c06\u9488\u5bf9<\/span><span lang=\"zh-CN\" style=\"color: red;\">\u968f\u673a\u9009\u62e9\u7684\u7b2c<\/span><span lang=\"zh-CN\" style=\"color: red;\">\u00a0<\/span><span lang=\"en-US\" style=\"font-style: italic; color: red;\">n<\/span><span lang=\"en-US\" style=\"color: red;\">\u00a0<\/span><span lang=\"zh-CN\" style=\"color: red;\">\u884c<\/span><span lang=\"zh-CN\" style=\"color: black;\">\u6267\u884c\u5220\u9664\u64cd\u4f5c<\/span><span lang=\"en-US\" style=\"color: black;\">.<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u4f8b\u5982<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u4e0b\u9762\u7684\u8bed\u53e5\u4ece<\/span><span lang=\"en-US\">\u00a0PurchaseOrderDetail\u00a0<\/span><span lang=\"zh-CN\">\u8868\u4e2d\u5220\u9664\u4e86\u5176\u5230\u671f\u65e5\u671f\u65e9\u4e8e<\/span><span lang=\"en-US\">\u00a02002\u00a0<\/span><span lang=\"zh-CN\">\u5e74<\/span><span lang=\"en-US\">\u00a07\u00a0<\/span><span lang=\"zh-CN\">\u6708<\/span><span lang=\"en-US\">\u00a01\u00a0<\/span><span lang=\"zh-CN\">\u65e5\u7684<\/span><span lang=\"en-US\">\u00a020\u00a0<\/span><span lang=\"zh-CN\">\u4e2a\u968f\u673a\u884c<\/span><span lang=\"en-US\">.<\/span><\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">USE AdventureWorks2008R2;<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">GO<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">DELETE TOP (20)<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">FROM Purchasing.PurchaseOrderDetail<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">WHERE DueDate &lt; &#8216;20020701&#8217;;<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">GO<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u5982\u679c\u9700\u8981\u4f7f\u7528<\/span><span lang=\"en-US\">\u00a0TOP\u00a0<\/span><span lang=\"zh-CN\">\u6765\u5220\u9664\u6309\u6709\u610f\u4e49\u7684\u65f6\u95f4\u987a\u5e8f\u6392\u5217\u7684\u884c<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u60a8\u5fc5\u987b\u540c\u65f6\u4f7f\u7528<\/span><span lang=\"en-US\">\u00a0TOP\u00a0<\/span><span lang=\"zh-CN\">\u548c<\/span><span lang=\"en-US\">\u00a0ORDER BY\u00a0<\/span><span lang=\"zh-CN\">\u5b50\u53e5<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u4e0b\u9762\u7684\u67e5\u8be2\u4ece<\/span><span lang=\"en-US\">PurchaseOrderDetail\u00a0<\/span><span lang=\"zh-CN\">\u8868\u4e2d\u5220\u9664\u4e86\u5176\u5230\u671f\u65e5\u671f\u6700\u65e9\u7684<\/span><span lang=\"en-US\">\u00a010\u00a0<\/span><span lang=\"zh-CN\">\u884c<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u4e3a\u4e86\u786e\u4fdd\u4ec5\u5220\u9664<\/span><span lang=\"en-US\">\u00a010\u00a0<\/span><span lang=\"zh-CN\">\u884c<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u5d4c\u5957<\/span><span lang=\"en-US\">\u00a0Select\u00a0<\/span><span lang=\"zh-CN\">\u8bed\u53e5<\/span><span lang=\"en-US\">(PurchaseOrderID)\u00a0<\/span><span lang=\"zh-CN\">\u4e2d\u6307\u5b9a\u7684\u5217\u5c06\u6210\u4e3a\u8868\u7684\u4e3b\u952e<\/span><span lang=\"en-US\">.<\/span><span lang=\"zh-CN\">\u5982\u679c\u6307\u5b9a\u5217\u5305\u542b\u91cd\u590d\u7684\u503c<\/span><span lang=\"en-US\">,<\/span><span lang=\"zh-CN\">\u5219\u5728\u5d4c\u5957<\/span><span lang=\"en-US\">\u00a0Select\u00a0<\/span><span lang=\"zh-CN\">\u8bed\u53e5\u4e2d\u4f7f\u7528\u975e\u952e\u5217\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5220\u9664\u7684\u884c\u8d85\u8fc7<\/span><span lang=\"en-US\">\u00a010\u00a0<\/span><span lang=\"zh-CN\">\u4e2a<\/span><span lang=\"en-US\">.<\/span><\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">USE AdventureWorks2008R2;<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">GO<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">DELETE FROM Purchasing.PurchaseOrderDetail<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">WHERE PurchaseOrderDetailID IN<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">(SELECT TOP 10 PurchaseOrderDetailID<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">FROM Purchasing.PurchaseOrderDetail<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">ORDER BY DueDate ASC);<\/span><\/span><\/p>\n<p lang=\"en-US\" style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 12pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">GO<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u4ee5\u4f7f\u7528\u00a0TOP\u00a0\u5b50\u53e5\u9650\u5236\u00a0DELETE\u00a0\u8bed\u53e5\u4e2d\u5220\u9664\u7684\u884c\u6570.\u5f53\u00a0TOP (n)\u00a0\u5b50\u53e5\u4e0e\u00a0DELETE\u00a0\u4e00\u8d77\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[16],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-sqlserver","tag-sql_server_2008_r2"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":0,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}