Skip to content
Advertisement

SQL QUERY TO SHOW FIRST IN AND FIRST OUT

my query like this :

output getting : enter image description here

BUT I NEED TO SHOW THE RESULT LIKE THIS enter image description here

Advertisement

Answer

Assuming that your in and outs are interleaved, you can use row_number() and aggregation:

For your particular query, this is a little simpler:

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