Oracle SQL. Time between states -
i have table this:
state || date; 00 || date1; 60 || date2; 00|| date3; 60 || date4...always exist 00 state , 60, sequence. cant know how many times sequence repeted. maybe 1 time, or two, in example, or three, or four...
i need calculate total time between estates 00 , 60, i.e. (date2-date1)+ (date4-date3)+...
thanks.
i not sure expecting subtract next date current date states 00. please specific in question u need
select id,trunc(next_day - day) (select id,day,lead(day) on (order day) next_day date_test) id = '00';
sql oracle
No comments:
Post a Comment