[resolved] How to select only maximum value from tMap?
Hi All, I would like to select only the maximum value of num. num column is located in table2.
Here is an sql example: select max(num) from table1 left join table2 on (condition1>condition2)
I have tried performing the above sql using tMap. table1 --> tMap --> table3 table2(lookup)
I have no problem trying to do a left join of table1 and table2 and I manage to include the condition at the filter in tMap. However, I do not know how to get the max(num). Table3 have an empty num column where I can input the max(num) into. Please help.
Tell what is your database (oracle? mySQL ? postgreSQL ? other ?) One way should be to convert from date to string, or better to integer, when selecting from table. You tSetGlobalVar to initialize a global variable.
@TRF, I manage to get it work with your working. Just that I used context.date instead of globalMap. I made some mistake in the code for context.date and that is why there is error message. But it's working now! Thanks!