Archives of the TeradataForum
Message Posted: Thu, 06 Sep 2012 @ 19:32:32 GMT
Subj: | | Re: Avoiding Multiple Views |
|
From: | | De Pons, Paul |
One way I can think of is to?create a cross reference table with Logon User ID to source system ID
CREATE TABLE USER_SOURCE_CROSS_REF
(USER_ID VARCHAR(50)
,SOURCE_SYSTEM_ID INTEGER
) UNIQUE PRIMARY INDEX (USER_ID)
Base table includes SOURCE_SYSTEM_ID
View would then be
CREATE BASE_VIEW AS
SELECT A.*
FROM BASETABLE AS A
INNER JOIN USER_SOURCE_CROSS_REF B
ON A.SOURCE_SYSTEM_ID = B.SOURCE_SYSTEM_ID
WHERE B.USER_ID = USER
|