Ok, after changes were made, I am still getting multiple release dates for 1 document title.
How does the system know that we want only the max date in LCH for unique ID's only?
Here's a sample of the tables:
WT table:
IDA2A2: TITLE
5455135 TEST1
1546413 TEST2
6754313 TEST3
3575313 TEST4
2484613 TEST5
4681843 TEST6
OBJECTHISTORY table:
IDA2A2: IDA3A5: IDA3B5:
8761649 5455135 6876468
3516463 1546413 6761393
3516464 1546413 6761394
3516465 1546413 6761395
3516466 1546413 6761396
4346796 6754313 3213946
4346797 6754313 3213947
49/8761 3575313 6484313
6846946 2484613 1318433
4646846 4681843 6313873
LIFECYCLEHISTORY table:
IDA2A2: UPDATESTAMPA2
6876468 MAY 8 2009
6761393 SEP 20 2006
6761394 JUN 1 2007
6761395 DEC 2 2005
6761396 DEC 15 2005
3213946 DEC 9 2004
3213947 NOV 2 2003
6484313 OCT 24 2006
1318433 JAN 26 2007
6313873 JAN 17 2005
Code:
select
A4.TITLE "DOC_TITLE" ,
A4.DESCRIPTION "DOC_DESC" ,
OBH.UPDATESTAMPA2 "RELEASE_DATE"
from
wc.WT A4 ,
wc.OBJECTHISTORY OBH
where
A4.ida2a2 = OBH.ida3a5 and
OBH.UPDATESTAMPA2 = (
select max(LCH.UPDATESTAMPA2)
from wc.LIFECYCLEHISTORY LCH
where LCH.ida2a2 = OBH.ida3b5
)
order by
1,3