I want to generate a self join query something similar to SQL showed below, I tried several ways but couldn't accomplish it. select time_stamp, metric_name, sum(metric_value) from metrics_table "t0" JOIN ( select metric_name, MAX(time_stamp) as time_stamp from metrics_table GROUP BY metric_name ) as "t1" where t0.metric_name = t1.metric_name and t0.time_stamp = t1.time_stamp Thanks for assistance!!!
I want to generate a self join query something similar to SQL showed below, I tried several ways but couldn't accomplish it. select timestamp, metric_name, sum(metric_value) from metrics_table "t0" INNER JOIN ( select metric_name, MAX(timestamp) as timestamp from metrics_table GROUP BY metric_name ) as "t1" where t0.metric_name = t1.metric_name and t0.timestamp = t1.timestamp Thanks for assistance!!!