title: Get the last timestamps in a group by time query in Influxdb
body: <p>I have a database with price and timestamps in nanoseconds measurement in InfluxDB. When I do a select grouped by time like this one:</p>
  
  <pre><code>select first(price),last(price) from priceseries where time&gt;=1496815212834974866 and time&lt;=1496865599580302882 group by time(1s)
  </code></pre>
  
  <p>I received a time column in which the timestamps is aligned to the second beginning the group. For example, the timestamp will be 08:00:00 and the next timestamps will be 08:00:01</p>
  
  <p>How to </p>
  
  <ol>
  <li>apply aggregation function on the record timestamps itself like last(time) or first(time) so that to have the real first and last timestamps of the group (I can have many prices within my group) ?</li>
  <li>and how the <code>time</code> column in the response could be the closing second and not the opening second, that is if the group goes from 08:00:00 to 08:00:01, I want to see 08:00:01 in my <code>time</code> column instead of 08:00:00 which I see now ?</li>
  </ol>