﻿{"id":91,"date":"2015-01-13T11:11:01","date_gmt":"2015-01-13T03:11:01","guid":{"rendered":"http:\/\/www.llku.com\/llku\/?p=91"},"modified":"2015-01-13T11:11:01","modified_gmt":"2015-01-13T03:11:01","slug":"%e8%8e%b7%e5%8f%96%e9%87%87%e8%b4%ad%e5%91%98%e7%9b%b8%e5%85%b3%e4%bf%a1%e6%81%afsql","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=91","title":{"rendered":"\u83b7\u53d6\u91c7\u8d2d\u5458\u76f8\u5173\u4fe1\u606fSQL"},"content":{"rendered":"<p>\n\tSELECT FFV.DESCRIPTION &nbsp; &nbsp; \u673a\u6784\u63cf\u8ff0,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PP.NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u804c\u4f4d,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FU.DESCRIPTION &nbsp; &nbsp; &nbsp;\u63cf\u8ff0,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PA.AGENT_ID &nbsp; &nbsp; &nbsp; &nbsp; \u91c7\u8d2d\u5458ID,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FU.USER_ID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u7528\u6237ID,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FU.USER_NAME &nbsp; &nbsp; &nbsp; &nbsp;\u7cfb\u7edf\u540d\u79f0,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PPF.FULL_NAME &nbsp; &nbsp; &nbsp; \u5168\u540d,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PPF.EMPLOYEE_NUMBER \u5458\u5de5\u7f16\u53f7\n<\/p>\n<p>\n\t&nbsp; FROM PER_PEOPLE_F &nbsp; &nbsp; &nbsp; &nbsp;PPF,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PER_ASSIGNMENTS_F &nbsp; PAF,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PER_POSITIONS &nbsp; &nbsp; &nbsp; PP,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FND_USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FU,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;PO_AGENTS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PA,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FND_FLEX_VALUES_VL &nbsp;FFV,<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;FND_FLEX_VALUE_SETS FF<br \/>\n\t&nbsp;WHERE PPF.PERSON_ID = PAF.PERSON_ID<br \/>\n\t&nbsp; &nbsp;AND FFV.FLEX_VALUE_SET_ID = FF.FLEX_VALUE_SET_ID<br \/>\n\t&nbsp; &nbsp;AND FFV.ENABLED_FLAG = &#39;Y&#39;<br \/>\n\t&nbsp; &nbsp;AND (FFV.END_DATE_ACTIVE IS NULL OR FFV.END_DATE_ACTIVE &gt; SYSDATE)<br \/>\n\t&nbsp; &nbsp;AND FFV.FLEX_VALUE = SUBSTR(PP.NAME, 1, INSTR(PP.NAME, &#39;.&#39;, 1, 1) &#8211; 1)<br \/>\n\t&nbsp; &nbsp;AND FF.FLEX_VALUE_SET_NAME = &#39;&amp;ORG_COA&#39;<br \/>\n\t&nbsp; &nbsp;AND FFV.SUMMARY_FLAG = &#39;N&#39;<br \/>\n\t&nbsp; &nbsp;AND PA.AGENT_ID = PPF.PERSON_ID<br \/>\n\t&nbsp; &nbsp;AND FU.EMPLOYEE_ID = PPF.PERSON_ID<br \/>\n\t&nbsp; &nbsp;AND PP.POSITION_ID = PAF.POSITION_ID<br \/>\n\t&nbsp; &nbsp;AND PPF.PERSON_ID IN<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp;(SELECT DISTINCT PA.AGENT_ID<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM PO_AGENTS PA, PER_ALL_PEOPLE_F PAPF, FND_USER FU<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE PA.AGENT_ID = PAPF.PERSON_ID<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND FU.EMPLOYEE_ID = PAPF.PERSON_ID<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND (PAPF.EMPLOYEE_NUMBER IS NOT NULL OR<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PAPF.NPW_NUMBER IS NOT NULL)<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND<br \/>\n\t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PAPF.EFFECTIVE_END_DATE)<br \/>\n\t&nbsp; &nbsp;AND SYSDATE BETWEEN PPF.EFFECTIVE_START_DATE AND PPF.EFFECTIVE_END_DATE<br \/>\n\t&nbsp; &nbsp;AND SYSDATE BETWEEN PAF.EFFECTIVE_START_DATE AND PAF.EFFECTIVE_END_DATE<br \/>\n\t&nbsp; &nbsp;AND (FU.END_DATE IS NULL OR FU.END_DATE &gt; SYSDATE)<br \/>\n\t&nbsp; &nbsp;AND (PP.DATE_END IS NULL OR PP.DATE_END &gt; SYSDATE)<br \/>\n\t&nbsp;ORDER BY PP.NAME, FU.CREATION_DATE DESC;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SELECT FFV.DESCRIPTION &nbsp; &nbsp; \u673a\u6784\u63cf\u8ff0, &nbsp; &#038;nbsp &hellip; <a href=\"https:\/\/www.llku.com\/?p=91\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u83b7\u53d6\u91c7\u8d2d\u5458\u76f8\u5173\u4fe1\u606fSQL<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":1,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/92"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}