What is the correct way to achieve such a query (not working) ?
SELECT Min(mydates_col) as oldest, Max(mydates_col) as newest,
COUNT(oneparticular_column) FROM mytable WHERE mydates_col BETWEEN oldest AND newest
I understand I can do that using 2 consecutive queries, fetching the min and max dates from the first query, then using thoses numbers to run a second query but I’m convinced there is a much better solution, not found after dozen of tries.
Thx.
Use inner query, not very nice (see my comments) but if you need to: