|
|
Archives of the TeradataForum
Message Posted: Tue, 09 Mar 2010 @ 15:48:34 GMT
Subj: | | Self joins are not allowed in Join Index!! |
|
From: | | Ahmad, Syed |
Hi,
I am running the below select query and it is running fine, once we want to create the join index it is giving the error that 5464: Error in
Join Index DDL, Self joins are not allowed.
Any help would be definitely appreciated.
CREATE JOIN INDEX WOFDWPRT.BUY_SELL_DLR_MV_JI AS
SELECT BSD.DLR_SK BSD_DLR_SK, BSD.DLR_BUY_SELL_NBR BSD_DLR_NBR_NK,
BSD.BUY_SELL_DLR_SK, BSD.DLR_NM BSD_DLR_NM, CLNT.CLNT_NBR BSD_CLNT_NBR,
CLNT.CLNT_SK BSD_CLNT_SK,
BSD.DLR_CLNT_CLSS_DESC BSD_DLR_CLNT_CLSS_DESC,
BSD.DLR_BUY_SELL_NBR_D_SK, BSD.RGN_CD BSD_RGN_CD,
BSD.RETL_DLR_FNDG_SRVC BSD_RETL_DLR_FNDG_SRVC,
BSD.DLR_SALE_REP BSD_DLR_SALE_REP, BSD.RGN_NM BSD_RGN_NM,
BSD.SET_DLR_IN BSD_SET_DLR_IN,
BSD.RETL_DLR_REF_NBR BSD_RETL_DLR_REF_NBR,
BSD.DLR_DBA_NM BSD_DLR_DBA_NM, BSD.DLR_ACTV_IN BSD_DLR_ACTV_IN,
BSD.DLR_DRCT_INDR_IN BSD_DLR_DRCT_INDR_IN,
BSD.SET_FLT_ID BSD_SET_FLT_ID,
BSD.DLR_OUT_OF_BUSN_DT BSD_DLR_OUT_OF_BUSN_DT,
BSD.DLR_ADDR_LN_1 BSD_DLR_ADDR_LN_1,
BSD.DLR_ADDR_LN_2 BSD_DLR_ADDR_LN_2, BSD.DLR_CITY_NM BSD_DLR_CITY_NM,
BSD.DLR_ZIP_CD BSD_DLR_ZIP_CD, BSD.DLR_ST_CD BSD_DLR_ST_CD,
BSD.DLR_CNTY_NM BSD_DLR_CNTY_NM,
BSD.DLR_CLNT_CLSN_1 BSD_DLR_CLNT_CLSN_1,
BSD.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