Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
https://dev.mysql.com/doc/refman/5.7/en/cursors.html
You normally declare a cursor for a select, then you open it, then define a loop. Inside the loop, you iterate (fetch) over every return that is returned by the select, until no more records are left, moment in which you leave the loop. Finally, you close the cursor.