You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hello everyone,
I'm new in Talend and need some help.
Which component can I use to create result set like such SQL:
SELECT *
FROM report
WHERE executiontime IN (SELECT MAX(executiontime) FROM report GROUP BY searchjob_id);
The table report looks like that:
searchjob_id search_id executiontime result
1 10 10.10.2008 AAA
1 12 12.10.2008 BBB
2 14 14.12.2008 CCC
2 15 11.12.2008 DDD
3 17 01.10.2008 EEE
As result I want to have somethink like that
searchjob_id search_id executiontime result
1 12 12.10.2008 BBB
2 14 14.12.2008 CCC
3 17 01.10.2008 EEE
The data come not from the table but from other component(tMap).
Thanks in advance
myklynysh
Offline
Hello
Which component can I use to create result set like such SQL:
tAggregateRow component can fit your need.eg:
...tMap-->tAggregateRow-->
Best regards
shong
Offline

Thank you for answer, shong.
I tried that. I can set the function for executiontime to MAX, but how can I define association to other record fields like search_id or result?
Which operation should I use? If don't define some operation, I get always 0 as return in these fields.
Offline
Hello
First, output the result come from tMap to file.
Second, link this file to a tAggregateRow, on tAggregateRow, only define two columns:searchjob_id and executiontime, then do a inner join with the file again based on executiontime column.
---tMap--tFileOutputDelimited
|
OnSubJobOK
|
tFileInputDelimited--tAggregateRow--lookup>tMap-->tLogRow
|
main
|
tFileInputDelimited
Best regards
shong
Offline
Pages: 1