MohamedG's Log

TW9oYW1lZCBFbC1HZWlzaA==

Nested For-each Loops in SQL

Usually, it’s not recommended that you use loops in SQL unless you need to. You should use set-based queries instead. However, if you need to, there are many ways to loop, one of them is using cursors. For example, let’s say that you have multiple DBs and you need to select count(*) from some tables… Read more