Ok got an answer for this one... here is it for those of you who come across this post...
Code:
select to_char(min(deviceDate), 'hh24:mi:ss'), community from
(
select devicedate, community,
max(rn)
over(order by devicedate) max_rn
from (
select devicedate, community,
case
when not (COMMUNITY = LCOMMUNITY) or lcommunity is null
I know what I am asking for is pretty hard, but still maybe there is someone out there who is able to solve my problem!
I have a table that look like this
CREATE TABLE VEHICLETRIPS
( VID NUMBER(10) NOT NULL,
VECHIELID VARCHAR2(10) NOT NULL,
DEVICEDATE DATE NOT NULL,
TRIPID NUMBER(10) NOT NULL,
COMMUNITY VARCHAR2(10) NOT NULL
) ;
Leave a comment: