I have output as below 

[![enter image description here](https://i.stack.imgur.com/Ak2oS.png)](https://i.stack.imgur.com/Ak2oS.png)

In the above code, Tx\_ID stays same but purchase second entry became NULL. so I got multiple rows. 

Now I have to calculate the time difference between first purchase and second purchase but always TX\_ID stays same. 

Any suggestions, greatly appreciated.

Thank you.