Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
Can anyone please help me to get the required result. I have data :
ID | Time | SeqNO |
12 | 20:00 | 34 |
12 | 20:45 | 35 |
12 | 20:55 | 36 |
12 | 21:34 | 37 |
12 | 21:47 | 1 |
12 | 21:56 | 2 |
13 | 22:00 | 43 |
13 | 22:14 | 44 |
13 | 22:45 | 45 |
14 | 22:49 | 23 |
14 | 22:51 | 24 |
13 | 23:00 | 1 |
13 | 23:01 | 2 |
13 | 23:02 | 3 |
14 | 23:04 | 25 |
14 | 23:15 | 26 |
14 | 23:20 | 27 |
From this data i want to get the IDs where the Time is increasing and seqNO is decreasing.
Output should be
12 | 21:47 | 1 |
13 | 23:00 | 1 |
Please help!
Thankyou in advance
Hi, you can try something like this:
LOAD
ID, Time, SeqNO
FROM ...sample...
WHERE SeqNO<previous(SeqNO) and ID=Previous(ID)
ORDER by ID, Time;