G
Guest
I am tracking a variable for different subjects over time. I want to find
the date and value of the FIRST local minimum, NOT the global minimum for
the subject.
Here is some sample data:
ID Value Date
1 10 1/10/03
1 5 1/10/04
1 1 1/10/05
1 0.5 1/10/06
1 2 3/10/06
1 0.1 3/12/06
1 4 3/16/06
2 3 1/10/01
2 1 1/10/02
2 1 3/10/02
2 2 6/10/02.
2 0.2 5/10/03
2 5 6/3/04
I want a query that will give the following results:
ID Value Date
1 0.5 1/10/06
2 1 1/10/02
Any suggestions on how to do this with SQL only or does it require a
recursive script?
the date and value of the FIRST local minimum, NOT the global minimum for
the subject.
Here is some sample data:
ID Value Date
1 10 1/10/03
1 5 1/10/04
1 1 1/10/05
1 0.5 1/10/06
1 2 3/10/06
1 0.1 3/12/06
1 4 3/16/06
2 3 1/10/01
2 1 1/10/02
2 1 3/10/02
2 2 6/10/02.
2 0.2 5/10/03
2 5 6/3/04
I want a query that will give the following results:
ID Value Date
1 0.5 1/10/06
2 1 1/10/02
Any suggestions on how to do this with SQL only or does it require a
recursive script?