Skip to content
Advertisement

How to fetch data from first row to a particular row

I have two tables table 1 (log_audit table) table 2 is (final_log table)

table 1 data looks like below

enter image description here

table 2 data looks like below

enter image description here

Here user “D” actual resolver of the customer ticket. so we want the data from ticket start time (i.e 2020-05-01 10:00:00) to till first assigned to the user “D” (here the ticket first assigned to “D” on “2020-05-01 10:20:00”)

The expected output should be like from 1st row to till 4th row

enter image description here

please help me on this.

Advertisement

Answer

You can use a left join and window functions:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement