Summarize mulitpe records into one
Posted: Mon Jan 03, 2005 12:43 pm
I have multiple records per individual, based on an individual type. Each one will either be A or I. (Active or inactive.)
I need to boil that down to one record per individual, that follows this business rule:
"If an individual has any active records, they are active."
i.e.
Three records:
John Doe, Type 1, A
John Doe, Type 2, A
John Doe, Type 3, I
One summary record:
John Doe, A
How can I do this with DataStage and SQL? (If I were writing a stored procedure I would step through the three records and keep an "active indicator".)
I need to boil that down to one record per individual, that follows this business rule:
"If an individual has any active records, they are active."
i.e.
Three records:
John Doe, Type 1, A
John Doe, Type 2, A
John Doe, Type 3, I
One summary record:
John Doe, A
How can I do this with DataStage and SQL? (If I were writing a stored procedure I would step through the three records and keep an "active indicator".)