{"id":233213,"date":"2020-12-29T03:51:13","date_gmt":"2020-12-28T19:51:13","guid":{"rendered":"http:\/\/4563.org\/?p=233213"},"modified":"2020-12-29T03:51:13","modified_gmt":"2020-12-28T19:51:13","slug":"oracle-%e6%89%a7%e8%a1%8c-sql-%e5%91%bd%e4%bb%a4%e6%97%b6%e5%a6%82%e4%bd%95%e5%b0%86%e6%8e%92%e5%ba%8f%e9%99%90%e5%ae%9a%e5%9c%a8%e5%ad%90%e6%9f%a5%e8%af%a2%e5%86%85%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=233213","title":{"rendered":"Oracle \u6267\u884c SQL \u547d\u4ee4\u65f6\u5982\u4f55\u5c06\u6392\u5e8f\u9650\u5b9a\u5728\u5b50\u67e5\u8be2\u5185\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Oracle \u6267\u884c SQL \u547d\u4ee4\u65f6\u5982\u4f55\u5c06\u6392\u5e8f\u9650\u5b9a\u5728\u5b50\u67e5\u8be2\u5185\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u73b0\u6709\u4e00\u8868\uff0c\u884c\u6570\u4e3a\u4e00\u5343\u4e07\u3002<\/p>\n<p>\u5185\u542b\u4e09\u5217 \uff0c \u5206\u522b\u4ee3\u8868\u5b66\u751f ID\uff0c \u63d2\u5165\u65f6\u95f4\uff0c\u503c<\/p>\n<p>sid(int) ,stime(date), sgrade(int)<\/p>\n<p>\u8be5\u8868\u4e3a sid \u548c stime \u7684\u590d\u5408\u7d22\u5f15\u3002<\/p>\n<p>\u6267\u884c\u5982\u4e0b\u8bed\u53e5<\/p>\n<pre><code>SELECT * FROM TABLE WHERE SID = 0 <\/code><\/pre>\n<p>\u5f97\u5230 5000 \u6761\u6570\u636e\uff0c\u641c\u7d22\u65f6\u95f4 0.2 \u79d2\u7b26\u5408\u9884\u671f<\/p>\n<p>\u7136\u800c\u5e0c\u671b\u5c06\u7ed3\u679c\u6309\u65f6\u95f4\u6392\u5e8f\u65f6\uff0c<\/p>\n<pre><code>SELECT * FROM TABLE WHERE SID = 0 ORDER BY STIME DESC  <\/code><\/pre>\n<p>\u6267\u884c\u65f6\u95f4\u53d8\u6210 13 \u79d2\uff0c\u663e\u7136\u4e0d\u7b26\u5408\u9884\u671f\u3002\u6211\u63a8\u6d4b\u662f\u56e0\u4e3a oracle \u9996\u5148\u5bf9\u5168\u8868\u8fdb\u884c order \u64cd\u4f5c\uff0c\u800c\u540e\u4ece\u4e2d\u53d6\u51fa sid=0 \u7684\u90e8\u5206\uff0c\u5bfc\u81f4\u901f\u5ea6\u53d8\u6162\u3002<\/p>\n<p>\u4e8e\u662f\u5c1d\u8bd5\u7528\u5b50\u67e5\u8be2\uff1a<\/p>\n<pre><code>SELECT * FROM (SELECT * FROM TABLE WHERE SID = 0) ORDER BY STIME DESC  <\/code><\/pre>\n<p>\u6267\u884c\u65f6\u95f4 26 \u79d2\uff0c\u4e0d\u80fd\u7406\u89e3\u539f\u56e0<\/p>\n<p>\u6709\u6ca1\u6709\u5927\u4f6c\u8bb2\u4e00\u4e0b\u8fd9\u4e2a\u64cd\u4f5c\u600e\u4e48\u5b9e\u73b0\uff0c\u611f\u89c9 oracle \u548c mysql \u867d\u7136\u90fd\u7528 sql \u8bed\u8a00\u5199\uff0c\u4f46\u662f\u5dee\u5f88\u591a\u5f88\u591a\u3002<\/p>\n<p>\u6211\u7684\u671f\u671b\u8868\u73b0\u662f\uff0c\u65e2\u7136 0.2 \u79d2\u80fd\u53d6\u51fa\u6307\u5b9a\u6570\u636e\uff0c\u90a3\u4e48\u518d\u82b1 0.1 \u79d2\u65f6\u95f4\u8fdb\u884c\u6392\u5e8f\u662f\u6b63\u5e38\u7684\uff0c\u5426\u5219\u4e0d\u6b63\u5e38\u3002<\/p>\n<p>\u8c22\u8c22<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4740330\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liprais <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u4f1a\u770b\u6267\u884c\u8ba1\u5212\u4e48                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4740331\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ayumilove <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Explain Plan +1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4740332\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @liprais <br \/>@ayumilove <br \/>\u4e0d\u4f1a\uff0c\u600e\u4e48\u770b\u554a\uff0c\u5927\u4f6c\u6559\u6559                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4740333\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : noyidoit <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @LeeReamond \u597d\u5144\u5f1f\uff0c\u5148\u767e\u5ea6\u4e00\u4e0b\uff0c\u5982\u679c\u770b\u4e0d\u61c2\u518d\u6765\u95ee                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Oracle \u6267\u884c SQL \u547d\u4ee4\u65f6&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233213"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233213"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233213\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233213"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}