View Single Post
  #9  
Old 6th November 2014, 04:58 PM
jazzy jazzy is offline
Member
 
Join Date: Nov 2010
Posts: 49
Default

Righto, it can be done with a single SQL query, but it would need to use the new FIRST_VALUE and LAST_VALUE SQL window functions.

eg:
http://www.postgresql.org/docs/9.3/...ial-window.html
or
http://sqlmag.com/sql-server-2012/h...unctions-part-1

I've never used them before, so I'd need to play around with it to get it to work, and I doubt whether MS query would support it, you'd need to import the data into a ridgy-didge SQL database.

If you can't get excel to do it, this is the way I'd go.
Reply With Quote