{"id":9937,"date":"2026-08-21T15:50:41","date_gmt":"2026-08-21T07:50:41","guid":{"rendered":"http:\/\/pipingpig.com\/index.php\/2026\/08\/21\/s3d-sql%e6%9f%a5%e8%af%a2runlength\/"},"modified":"2026-08-21T15:50:41","modified_gmt":"2026-08-21T07:50:41","slug":"s3d-sql%e6%9f%a5%e8%af%a2runlength","status":"publish","type":"post","link":"https:\/\/www.pipingpig.com\/index.php\/2026\/08\/21\/s3d-sql%e6%9f%a5%e8%af%a2runlength\/","title":{"rendered":"S3D-SQL\u67e5\u8be2RunLength"},"content":{"rendered":"<p>\u5173\u952e\u8bcd\uff1a SQL\uff0c RunLength\uff0c XAlongLeg\uff0c CORERelationOrigin \u95ee\u9898\u63cf\u8ff0\uff1a RunLength\u901a\u5e38\u83b7\u5f97\u65b9\u5f0f\uff0c\u662f\u901a\u8fc7\u5b98\u65b9\u7684A dditional- Label\u3002\u672c\u6b21\u5206\u4eab\u91cd\u70b9\u5173\u6ce8\u5982\u4f55\u5728SQL\u4e2d\u5b9e\u73b0 RunLength\u7684\u67e5\u8be2\u3002 \u611f\u5174\u8da3\u7684\u4f19\u4f34\uff0c\u6572\u5230\u81ea\u5df1\u73af\u5883\u4e2d\uff0c\u63a2\u7d22\u8bd5\u4e00\u8bd5\u3002 &#8211;\u5728MDB\u4e2d\u67e5\u8be2 SELECT subquery.oidOrigin, MIN (subquery.ItemName) AS ItemName, SUM (subquery.Distance) AS TotalDistance FROM ( SELECT DISTINCT j1.ItemName, x1.oidOrigin, c1.oid, &#8211;\u4e24\u70b9\u6c42\u957f SQRT ( POWER (r1.EndLocationX &#8211; r1.StartLocationX, 2 ) + POWER (r1.EndLocationY &#8211; r1.StartLocationY, 2 ) + POWER (r1.EndLocationZ &#8211; r1.StartLocationZ, 2 ) ) * 1000 AS Distance &#8211;1000\u63a7\u5236\u5355\u4f4d FROM XPathSpecification x1 INNER JOIN CORERelationOrigin c1 ON x1.oidDestination = c1.oidTarget INNER JOIN ROUTEPathLeg r1 ON c1.oid = r1.oid INNER JOIN JNamedItem j1 ON j1.oid = x1.oidOrigin WHERE c1.RelationType = &#039;B075C7A3-9F26-11D1-BE28-08003651A403&#039; &#8211;XAlongLeg AND x1.oidOrigin = &#039;\u6b64\u5904\u8f93\u5165Run\u7684Oid\uff0c\u5982\u5220\u9664\u6b64\u884c\uff0c\u5219\u5168\u5c40\u641c\u7d22&#039; &#8212; \u6d4b\u8bd5\u7528Oid ) AS subquery GROUP BY subquery.oidOrigin;<\/p>\n<p><video controls preload=\"metadata\" style=\"width:100%;max-width:860px;border-radius:8px\" src=\"https:\/\/www.pipingpig.com\/wp-content\/uploads\/2026\/08\/ersrc_v\/54_S3D-SQL\u67e5\u8be2RunLength.mp4\"><\/video><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u952e\u8bcd\uff1a SQL\uff0c RunLength\uff0c XAlongLeg\uff0c CORERelationOrigin \u95ee\u9898\u63cf\u8ff0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9936,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[28],"tags":[],"class_list":["post-9937","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/posts\/9937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/comments?post=9937"}],"version-history":[{"count":0,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/posts\/9937\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/media\/9936"}],"wp:attachment":[{"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/media?parent=9937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/categories?post=9937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pipingpig.com\/index.php\/wp-json\/wp\/v2\/tags?post=9937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}