Skip to content
Advertisement

How to delete records of orders that is canceled within 5 minutes in database?

I have a record of users’ purchasing behavior. However, it is long and includes a lot of redundant data. I want to delete orders that purchased and deleted within 5 min

My query so far: –TABLE 3 COD

For simplicity, i got this result

We know that users can only cancel their orders within 5 minutes, unfortunately, there is a lot of cancels. I need to make this data table simple and short so as to track and visualize it easily.

Here is my expectataion:

Advertisement

Answer

You can try using lead()

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