On 24 Nov 2011, at 6:18pm, Rafael Garcia Leiva wrote:

>> SELECT MAX(high) AS High, MIN(low) as Low,
>>    STRFTIME('%Y-%m-%d',date) as Date
>>    FROM eurusd GROUP BY round(STRFTIME('%s',date) / (23 * 60))
> 
> Many thanks for the answers. That's exactly what I was looking for!
> 
> Just one final remark, the round() function groups minutes from, from 
> example, 3 to 7, but I really want to group minutes from 0 to 4.

If floor doesn't do what you want you can Add or substract a number before 
rounding:

>> GROUP BY round((STRFTIME('%s',date) + 2)/ (23 * 60))

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to