This seems a conceptually easy question, but with no straightforward answer.
I have some time-serious data, with a whole bunch (millions) of unique events given by the event_ID variable, describing a set (of several) physical properties (phys_props).
I'm writing SQL and want to return every nth row (where I have freedom to choose n to be e.g. 5, 1000, 10000 etc.) for this time-series dataset.
However, if e.g. n=1000 and there are less than 1000 records for a given physical property, I don't want to return the event_ID records there at all.
Something like:
SELECT *
FROM myTable
WHERE MOD(myTable, 1000) = 0
is my starting point.