dynamic subqueries - dynamic macros