MYSQL : First and last record of a grouped record (aggregate functions)
- by Jimmy
I am trying to do fectch the first and the last record of a 'grouped' record. More precisely, I am doing a query like this
SELECT MIN(low_price), MAX(high_price), open, close
FROM symbols
WHERE date BETWEEN(.. ..)
GROUP BY YEARWEEK(date)
but I'd like to get the first and the last record of the group. It could by done by doing tons of requests but I have a quite large table.
Is there a [low processing time if possible] way to do this with MySQL?