hello, i am looking for an SQL query, that selects exactly rows ordered by date from a table. for this there is a column that contains a timestamp.
and here comes the tricky part: it should not select rows that are older than a certain time, but it should still select at least X rows. so if in the given time there are not more than X rows, it should move the time back until it has at least X rows.
thanks!