Statement for calculating the mileage generation time

Source: Internet
Author: User

Http://www.itpub.net/forum.php? MoD = viewthread & tid = 1711973 & page = 1

 

Actual Application statement:
Select lead (T. gpstime, 1) over (order by T. gpstime DESC) Start Time,
T. gpstime End Time,
Round (T.GPSTIME-LEAD (T. gpstime, 1) over (order by T. gpstime DESC) * 24*60) travel time,
Lead (T. Distance, 1) over (order by T. gpstime DESC) Start mileage,
T. Distance end mileage,
T.DISTANCE-LEAD (T. Distance, 1) over (order by T. gpstime DESC) mileage
From t_history t
Where T. gpstime between to_date ('1970-08-19 ', 'yyyy-MM-DD') and
To_date ('1970-08-20 ', 'yyyy-MM-DD ')
And T. unit_id = 87948
And T. Distance <> 0
Order by T. gpstime;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.