{"id":2170,"date":"2012-03-22T11:35:34","date_gmt":"2012-03-22T03:35:34","guid":{"rendered":"http:\/\/jason695.why3s.tw\/wordpress\/?p=2170"},"modified":"2012-03-22T16:39:07","modified_gmt":"2012-03-22T08:39:07","slug":"2170","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2012\/03\/22\/2170\/","title":{"rendered":"\u9010\u7b46\u5411\u524d\u56de\u5beb\u7684SQL"},"content":{"rendered":"<p>SQL\uff1a<\/p>\n<pre lang=\"SQL\">drop table #tmp\r\n\r\nselect '20120301' datadate\r\n\t, '020' brno\r\n\t, null amt\r\n\t, 1 rid\r\ninto #tmp\t \r\n\r\ninsert into #tmp\r\nselect '20120302','020',null ,2\r\nunion all\r\nselect '20120303','020','333' ,3\r\nunion all\r\nselect '20120304','020',null , 4\r\nunion all\r\nselect '20120305','020','555' ,5\r\nunion all\r\nselect '20120306','020','666' ,6\r\n\r\nselect * from #tmp order by rid\r\n--select * into #tmp_1 from #tmp\r\nselect * from #tmp_1 order by rid\r\n\r\nupdate A set A.amt= B.amt\r\nfrom #tmp A\r\nleft join #tmp B\r\non 1=1\r\nwhere  b.rid &gt; A.rid and B.brno = A.brno\r\nand B.amt is not null and A.amt is null<\/pre>\n<p>\u7d50\u679c\uff1a<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/jason695.why3s.tw\/wordpress\/wp-content\/uploads\/%E5%BD%B1%E5%83%8F028.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-2173\" title=\"\u5f71\u50cf028\" src=\"https:\/\/i0.wp.com\/jason695.why3s.tw\/wordpress\/wp-content\/uploads\/%E5%BD%B1%E5%83%8F028.jpg?resize=223%2C325\" alt=\"\" width=\"223\" height=\"325\" srcset=\"https:\/\/i0.wp.com\/jason695.why3s.tw\/wordpress\/wp-content\/uploads\/%E5%BD%B1%E5%83%8F028.jpg?w=223&amp;ssl=1 223w, https:\/\/i0.wp.com\/jason695.why3s.tw\/wordpress\/wp-content\/uploads\/%E5%BD%B1%E5%83%8F028.jpg?resize=205%2C300&amp;ssl=1 205w\" sizes=\"auto, (max-width: 223px) 100vw, 223px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL\uff1a drop table #tmp select &#8216;20120301&#8217; datadate , &#8216;020&#8217; &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2012\/03\/22\/2170\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">\u9010\u7b46\u5411\u524d\u56de\u5beb\u7684SQL<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2170","post","type-post","status-publish","format-standard","hentry","category-5","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/2170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=2170"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/2170\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=2170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=2170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=2170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}