Group by clause implementation in Datastage
Posted: Fri Feb 03, 2017 3:15 am
Dear Members,
I have a requirement as below:
Select first row
From TEXT
Where TEXT.OID = 2498
And TEXT.TEXT in ('Discharge', 'Expired')
Group by TEXT.OID
Order by TEXT.STARTDTIME Asc
The source TEXT is Flat file.There are mutiple STARTDTIME for same OID and we have to pick up the least one .
We designed as below:
SEQFile Stage---->RDC-----Xfrm-----Target dataset
In RDC,we used OID as key and Partitioning tab
did HashPartitioning on OID and Sort on STARTDTIME.Not used Sort on OID.
We received proper output.Wanted to check with you if this approach is fine or we need to sort OID also along with Partitioning.
Thanks,
Rumu
I have a requirement as below:
Select first row
From TEXT
Where TEXT.OID = 2498
And TEXT.TEXT in ('Discharge', 'Expired')
Group by TEXT.OID
Order by TEXT.STARTDTIME Asc
The source TEXT is Flat file.There are mutiple STARTDTIME for same OID and we have to pick up the least one .
We designed as below:
SEQFile Stage---->RDC-----Xfrm-----Target dataset
In RDC,we used OID as key and Partitioning tab
did HashPartitioning on OID and Sort on STARTDTIME.Not used Sort on OID.
We received proper output.Wanted to check with you if this approach is fine or we need to sort OID also along with Partitioning.
Thanks,
Rumu