Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Group by latest date

2806078Apr 1 2017 — edited Apr 3 2017

Hi,

I'm trying to work out how to write a query based on the following data:

2017-03-01 15:00 | device1 | on

2017-03-01 14:00 | device1 | off

2017-03-01 13:00 | device2 | off

2017-03-01 12:00 | device2 | on

2017-03-01 11:00 | device1 | on

what i would like is everything that is "on" only, so as you can see device2 latest status is off so it wouldn't return in the query but device1 went on at 15:00 so it would be in the report as one entry at 15:00.

I'm stuck as to how to write this query, any help would be appreciated.

thanks in advance.

mike.

This post has been answered by Paulzip on Apr 1 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2017
Added on Apr 1 2017
11 comments
1,339 views