How can i put second query in a cursor and loop it and how can i update the top query

Printable View