title: How to get timeseries partition data in single query sqlalchemy python?
body: <p>I am using the Postgresql database with sqlalchemy orm in python. I want represent sales graph for a week. I am storing the <code>unix timestamp</code> of the sale at any any moment in DB. Now in the x-axis, I have 6 points like sat-sun, sun-mon... Thu-Fri. Now i can get the result for exaple sat-sun by following query:-</p>
  <pre><code>result = db.query(SalesTable).filter(and_(SalesTable.when_in_unix_time &gt;= self.start_time,
                   SalesTable.when_in_unix_time &lt;= self.end_time)).all()
  </code></pre>
  <p>Now i need to do <strong>6 query to get 7 days aka 1 week's result</strong>, right? How to get the result in one query as a partition of from one day to next day?</p>