Hello SQL Expert,
I have a simple query as stated below:
Select Driver_ID, Registered_Begined, Registered_Ended
and the output from the above query is:
What I am trying to do is:
- To find the Registration gap day when the driver begins registered, ended and begin again
Here is the result set I want when I run the updated query from question # 1.
So, on the # 2 question, I want to combine the same "Registration Gap" and take the Min Date as the Register_Beginned Date and Max Date as the Register_Ended date, in this case is NULL.
- How do I update the final query so get below result set:
Anyone can help me with this sql trick?
Thank you all