aggregator stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

aggregator stage

Post by mab_arif16 »

Hi
Can we impliment this query in data stage

select count(*) ,col1,col2,col3,min(col4) from #table1 (which is output data from transformer) group by col1,col2,col3 where count(*) > 1

Thanks in advance for help

ARif
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No, but only because it's illegal SQL (not a DataStage issue). You need HAVING instead of WHERE.

That said, your metadata (table definition) requires one Integer column whose derivation is COUNT(*) and four other columns to match the other columns in your query.

Note that, in some databases, Count(ColX) is more efficient than Count(*) depending on the type of index used on ColX.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Yes you can. Sort the data using sort stage. Have KeyValueChange option enabled. Filter out (select only) those whose Key has not changed atleast for once. And do aggregation.
Or simply aggregat and filter based on the additional column.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

ray.wurlod wrote:No, but only because it's illegal SQL (not a DataStage issue). You need HAVING instead of WHERE.

That said, your metadata (table definition) requires one Integer column whose derivation is COUNT(*) and four other columns to match the other columns in your query.

.
Yeah you are right ,I am sorry I made mistake while typing.

Thanks
Post Reply