title: SQL Alternative to For Loop
body: <p>I'm working with SQL in Access.  I'm not much of a programmer, but I'm familiar with using VBA as well as SQL basics.</p>
  
  <p>What I'm trying to accomplish is the equivalent in SQL of a for loop used in Visual Basic.  I know this isn't "technically" possible in SQL and may not be the best method so I'm looking for advice.  I know it can be accomplished for i=1,2,3, etc. by using unions and repeating the query for each value.  This is inefficient and easily gets too complex to be evaluated.</p>
  
  <p>Basically what I need is a method to query for i=1 then repeat and again output data for i=2 and so on.  Using group by i is not an option because there are several subqueries involved as well.</p>
  
  <p>Thanks in advance!</p>