Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

SQL get latest 5 rows

Hi Experts,
I have the following table
vessel | reportdatetime | latitude | longitude
From the table I need the latest 5 latitude and longitudes for a particular vessel. Mostly there are more then 5 rows, but it can be less or zero.

Can someone give me some assistence?
Regards, MB
0
mark_norge
Asked:
mark_norge
1 Solution
 
Pratima PharandeCommented:
replace vessel = 1 with your perticular value


select top 5 * from tablename
where vessel = 1
order by reportdatetime desc
0
 
mark_norgeAuthor Commented:
Excellent, thanks a lot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now