Convert Log table days in a state
select item, 
       sum(duration),
       moved_to
from (
  select item, 
         lead(move_date)  over (partition by item order by move_date) - move_date as duration,
         moved_to
  from movement         
) t
group by item, moved_to
order by item, moved_to;


SQLFiddle example: http://www.sqlfiddle.com/#!4/dff2c/1