Suppose this table
create table test (
Id Number,
search_date date,
start_date date
End_date date);
Is it possible to write an analytic function that for every row counts all rows where the search_date of the current row is in the range of start_date and End_date? The current row should be skipped in the count.
The data is rather random, the only prerequesit is that start_date < End_date for each row.