BI Publisher – SQL for Opportunities
Get Sales Method
SELECT * FROM MOO_SALES_METHOD_TL WHERE name LIKE '%%' SELECT DISTINCT SALES_METHOD_ID, NAME FROM MOO_SALES_METHOD_TL
Get Sales Stages
select * from MOO_STG_B SELECT A.SALES_METHOD_ID, TL.NAME as METHOD_NAME, B.STG_ID as SALES_STAGE_ID, T.NAME as SALES_STAGE_NAME FROM (SELECT DISTINCT STG_ID FROM MOO_STG_B) B INNER JOIN MOO_STG_B A ON (B.STG_ID = A.STG_ID) INNER JOIN MOO_STG_TL T ON (B.STG_ID = T.STG_ID) INNER JOIN MOO_SALES_METHOD_TL TL ON (A.SALES_METHOD_ID = TL.SALES_METHOD_ID) ORDER BY A.SALES_METHOD_ID,T.NAME SELECT SALES_METHOD_ID, STG_ID, PHASE_CD, STAGE_STATUS_CD, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE FROM MOO_STG_B WHERE SALES_METHOD_ID IN (SELECT SALES_METHOD_ID FROM MOO_SALES_METHOD_TL WHERE name LIKE '%%'
Get Opportunities
SELECT * FROM MOO_OPTY
Get Data Comparison
SELECT COUNT(*) FROM MOO_OPTY WHERE STATUS_CD IN ('OPEN', 'In Progress', 'Waiting on Customer') AND (EFFECTIVE_DATE BETWEEN to_date('2014-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND to_date('2021-01-31 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))
Opportunity Assignment
SELECT * FROM MOW_BATCH_ASGN_JOB_ITEMS WHERE ESS_REQUEST_ID =AND rownum < 10 AND JOB_ITEM_STATUS = '-1' SELECT COUNT(*) FROM MOW_BATCH_ASGN_JOB_ITEMS WHERE ESS_REQUEST_ID = 147720 AND JOB_ITEM_STATUS = '-1' AND ERROR_MESSAGE LIKE '%Restrict_Upd_opty_Summary_Page_%'