PDA

View Full Version : Error Metdata form Oracle ORA-00937: not a single-group group function



daslan
04-09-2008, 10:51 AM
Hi

The SQL generated by metadata does not run. How do you do a group by in Metadata 1.7.0.0.3?

Tks,
das

SELECT DISTINCT
SNAPSHOT_DLY.ACC_CAPITAL_ACTUAL_BAL AS COL0
,SNAPSHOT_DLY.ACC_ADV_INT_ACCR_DUED_MEND_AMT AS COL1
,SNAPSHOT_DLY.ACC_MISC_SXC_NUM AS COL2
,SNAPSHOT_DLY.ACC_INT_ACCR_DUED_MEND_AMT AS COL3
,SNAPSHOT_DLY.BOOK_CNT AS COL4
,SNAPSHOT_DLY.SNAPSHOT_DATE AS COL5
,SNAPSHOT.DA_ACTUAL_DATE AS COL6
,ORGANISATION.FCO_OPER_NAME AS COL7
,CUSTOMER.COUNTRY_CODE AS COL8
,ACCOUNT.OPEN_CLOSED_TYPE AS COL9
,sum(ACC_CAPITAL_ACTUAL_BAL) AS COL10
FROM
TD_ORGANISATION_DIM ORGANISATION
,TFSCOR_ACC_SNAPSHOT_DLY_FACT_P SNAPSHOT_DLY
,VDCOL_CUSTOMER_DIM CUSTOMER
,VDCOR_ACCOUNT_DIM ACCOUNT
,VD_TIME_SNAPSHOT_DIM SNAPSHOT
WHERE
ORGANISATION.ORG_UNIT_ID = SNAPSHOT_DLY.SK_ORG_UNIT_SOURCE_ID
AND CUSTOMER.CUSTOMER_ID = SNAPSHOT_DLY.SK_CUSTOMER_ID
AND ACCOUNT.ACCOUNT_ID = SNAPSHOT_DLY.SK_ACCOUNT_ID
AND SNAPSHOT.DA_TIME_DAY_ID = SNAPSHOT_DLY.SK_TIME_DAY_SNAPSHOT_ID
AND (
( ACCOUNT.OPEN_CLOSED_TYPE = 'OPEN' )
AND ( SNAPSHOT_DLY.SNAPSHOT_DATE = '31-MAR-2008' )
)