0

I have an mysql table with file information with the following partially structure:

id  filename    size(mb)      status
1   one.pdf       100         active
2   two.pdf       200         active
3   three.pdf     50          active
4   four.pdf      120         active

Considering, for example, that I have a 300Mb limit, I want to update the status to inactive for the following rows after that value is reached. This would be the final result:

id  filename    size(mb)      status
1   one.pdf       100         active
2   two.pdf       200         active
3   three.pdf     50          inactive
4   four.pdf      120         inactive

Is there any way to do this with an mysql instruction to avoid performance issues by doing it programmatically?

Thanks

Deepak Rai
  • 2,163
  • 3
  • 21
  • 36

0 Answers0