title: sql query with alias name
body: <p>i have a table with this columns--- Or</p>
  
  <pre>
  orgid ispaid validity      noofthingstoTake
  
  1      yes    2010-06-05      20
  2      yes    2010-06-09       7
  </pre>
  
  <p>i have used this query(to join two more tableS):</p>
  
  <pre><code>select distinct B.RequirementID,A.OrganizationID 
  from 
  Organization A,RequirementsDetailsforOrganization B,validityorgdet F
  where A.OrganizationID=B.OrganizationID and F.orgid=A.OrganizationID and
   F.ispaid=1 and F.validity&gt;=GETDATE() and 
  
    F.noofthingstoTake&gt; ?? 
  </code></pre>
  
  <p>but i dont know how to check the (noofthingstaken) over here. it should not exceed 20. im passing this query from my code behind page to the Sql. how to get the query excute to check it should not exceed the noofthingstaken</p>
  
  <p>pls help me out....????</p>