I have a table with some foreign keys, I need to get a report of when these keys change.
from | to | timestamp 1 | 2 | 0000 1 | 2 | 0001 1 | 2 | 0002 1 | 3 | 0003 1 | 3 | 0004 1 | 2 | 0005
SELECT from,to,FIRST(timestamp) FROM table GROUP BY from,to;
from | to | timestamp 1 | 2 | 0000 1 | 3 | 0003
I can do Group By to get the first two, transitions but it groups the third in with the first and I am not able to see it when it goes back.
I would like to make a query that gets following:
from | to | timestamp 1 | 2 | 0000 1 | 3 | 0003 1 | 2 | 0005
Is it possible?