B2B Data Exchange
- B2B Data Exchange 10.5.3
- All Products
select topData.PARTNER_ID, dp.PARTNER_NAME, topData.SUM_COUNT from (select facts.PARTNER_ID, sum(EVENT_COUNT) as SUM_COUNT from DX_ODS_EVENT_FACTS facts where to_timestamp('2012-01-01' || '00:00:00','YYYY-MM-DD HH24:MI:SS') <= facts.TIMESLICE and facts.TIMESLICE <= to_timestamp('2012-06-01' || '00:00:00','YYYY-MM-DD HH24:MI:SS') ) group by facts.PARTNER_ID order by SUM_COUNT desc ) topData join DX_ODS_PARTNER dp on topData.PARTNER_ID = dp.PARTNER_ID order by topData.SUM_COUNT desc, dp.PARTNER_NAME asc
PARTNER_ID
| PARTNER_NAME
| SUM_COUNT
|
---|---|---|
1000
| My partner A
| 14781
|
1002
| My partner C
| 12920
|
1001
| My partner B
| 65044
|
select topData.PARTNER_ID, dp.PARTNER_NAME, topData.SUM_COUNT from (select facts.PARTNER_ID, sum(EVENT_COUNT) as SUM_COUNT from DX_ODS_EVENT_FACTS facts where to_timestamp('2012-01-01' || '00:00:00','YYYY-MM-DD HH24:MI:SS') <= facts.TIMESLICE and facts.TIMESLICE <= to_timestamp('2012-06-01' || '00:00:00','YYYY-MM-DD HH24:MI:SS') and (exists (select ua.ACCESS_ID from DX_ODS_USER_ACCESS ua where ua.ACCESS_ID = facts.ACCESS_ID and ua.USER_ID = 999) or exists (select * from DX_ODS_USER_SUPER ua where ua.USER_ID = 999) ) group by facts.PARTNER_ID order by SUM_COUNT desc ) topData join DX_ODS_PARTNER dp on topData.PARTNER_ID = dp.PARTNER_ID order by topData.SUM_COUNT desc, dp.PARTNER_NAME asc
PARTNER_ID
| PARTNER_NAME
| SUM_COUNT
|
---|---|---|
1000
| My partner A
| 14781
|
1002
| My partner C
| 12920
|
1001
| My partner B
| 65044
|
DEFINE fromDate = to_timestamp('01-03-2012 00.00.00.00', 'DD-MM-YYYY HH24.MI.SS.FF'); DEFINE toDate = to_timestamp('05-03-2012 23.59.59.00', 'DD-MM-YYYY HH24.MI.SS.FF'); DEFINE eventAtt = "'ClaimValue'"; SELECT p.PARTNER_ID, NVL(VALUE_SUM, 0) AS VALUE_SUM FROM (SELECT p.PARTNER_ID, SUM(VALUE_SUM) AS VALUE_SUM FROM DX_ODS_CUSTOM_FACTS cf JOIN DX_ODS_EVENT_FACTS ef ON ef.ROW_ID = cf.FACT_ROW_ID JOIN DX_ODS_PARTNER p ON ef.PARTNER_ID = p.PARTNER_ID JOIN DX_ODS_CUSTOM_FACTS_EAV cfe ON cf.EVENT_ATTRIBUTE_ID = cfe.ID WHERE cf.TIMESLICE >= &fromDate AND cf.TIMESLICE < &toDate GROUP BY p.PARTNER_ID ) SUM_ATT RIGHT JOIN DX_ODS_PARTNER p ON SUM_ATT.PARTNER_ID = p.PARTNER_ID
PARTNER_ID
| VALUE_SUM
|
---|---|
1000
| 544
|
1002
| 1060
|
1001
| 865
|