SQL/SPUFI Question - 2 refs to same table



IBM's flagship relational database management system

SQL/SPUFI Question - 2 refs to same table

Postby dp3546dp3546 » Sun May 23, 2010 7:52 am

I have tables A and B from an old system and tables D and E from a new system. They both use table C.

I already show the old name (C.NAME). How can I get this SQL (using SPUFI) to also show then new name (C2.NAME)?

SELECT A.CONTRACT, -- OLD CONTRACT
C.NAME -- OLD NAME
FROM TABLEA A,
TABLEB B,
TABLEC C
WHERE ...
...
AND A.CONTRACT IN(
SELECT D.OLD_CONTRACT
FROM TABLED D,
TABLEE E,
TABLEC C2
WHERE ...
...
AND C.NAME ^= C2.NAME) -- OLD NAME DOES NOT MATCH NEW NAME
;
dp3546dp3546
 
Posts: 3
Joined: Sun May 23, 2010 7:09 am
Has thanked: 0 time
Been thanked: 0 time

Re: SQL/SPUFI Question - 2 refs to same table

 

Re: SQL/SPUFI Question - 2 refs to same table

Postby GuyC » Tue May 25, 2010 1:56 pm

SELECT A.CONTRACT, -- OLD CONTRACT
C.NAME -- OLD NAME
FROM TABLEA A,
TABLEB B,
TABLEC C,
TABLED D,
TABLEE E,
TABLEC C2
WHERE ...
...
and a.contract = d.contract
AND C.NAME ^= C2.NAME
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post