Skip to content
Advertisement

MySQL get previous day data

I have the following table

What I try to get is writing the day before data on the following day

I can get yesterday but don’t know how to do it for all rows.

Thanks,

Advertisement

Answer

You can use next approach.

In this query we use join same table to itself by date with 1 day shift.

DB Fiddle

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