finding max date from a file grouping by another column
Posted: Sat Apr 25, 2009 6:30 am
hi,
i have a sequential file stage with input columns :
status varchar
completed_date timestamp
the column status will have value as 'S' and 'C'. i want to pick the maximum date from the completed_date column with status as 'C' and load it in the target file.
i used the logic of filtering the columns with status='C' in the 'where' clause and then agreegating. but this did not work since agrregation will not work on time stamp. the time is displayed as 'yyyy-mm-dd hh:mm:ss.000'
need some help on this
i have a sequential file stage with input columns :
status varchar
completed_date timestamp
the column status will have value as 'S' and 'C'. i want to pick the maximum date from the completed_date column with status as 'C' and load it in the target file.
i used the logic of filtering the columns with status='C' in the 'where' clause and then agreegating. but this did not work since agrregation will not work on time stamp. the time is displayed as 'yyyy-mm-dd hh:mm:ss.000'
need some help on this