In general, reusing the same variable can be confusing, depending on how your code is structured. But this should not be the final type of rule. Representation of a group of variables with names like query1, query2, etc. Could be even worse.
One thing I propose to do is refactor your code so that the common parts are inside a function or method. Thus, the scope of the variable will be limited by this function or method.
source share