title: How to filter content of resultset in java
body: <p>I have a scenario like this :<br/>
  I have a website that users send range of date for example <code>2013-01-01</code> to <code>2013-01-04</code> and then I need to get some information from the database for each day in a range for example in the above scenario I have to send request to database 3 times:</p>
  
  <pre><code>2013-01-01 to 2013-01-02,2013-01-02 to 2013-01-03,2013-01-03 to 2013-01-04
  </code></pre>
  
  <p>so as you can see if I want to extract for a month then this would take so long. A better and faster Idea is to call database once and extract all information , for example this range  <code>2013-01-01</code> to <code>2013-01-04</code>, all at once and filter information according to each day in java.</p>
  
  <p>Is there anyway that I can do that in java with the help of result set? I appreciate also if anyone has a better idea to handle this scenario ?</p>
  
  <p><strong>Update :</strong>  </p>
  
  <p>Here is the query that I am using :</p>
  
  <pre><code>SELECT enID, sum(frequency) from entity-epoch
  WHERE dateID IN(
      SELECT dateid
      WHERE startdate&gt;=2013-01-01 AND enddate&lt;=2013-01-02)
  GROUP BY sum(frequency)
  </code></pre>
  
  <p>and I have a loop thatcall it for each day?(instead of thoes dates above that I put for better readability I have ? and feed it with different dates.</p>