0

I have a mysql table that look like this

enter image description here

I'm trying to create a mysql request that will give me, for a specific node, the last available value of each type ( and I have the list of type in another table ).

I really have no idea if its even possible or the right approach to do this kind of task,... i'm not an expert in mysql

1 Answers1

0

I would be inclined to use a correlated subquery in a WHERE clause. I think you are asking for:

select d.*
from data d
where d.date = (select max(d2.date)
                from data d2
                where d2.node = d.node and d2.type = d.type
               );
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786