Well, i think i have it. It was easier than i thought.
select a.player_id, a.team_id, a.starting_date, min(b.starting_date)
from player_team a
left outer join player_team b
on a.player_id = b.player_id
and b.starting_date > a.starting_date
group by a.player_id, a.team_id, a.starting_date
order...
Hi all.
Suppose we have a table PLAYER_TEAM which stores the team (TEAM_ID) a player (PLAYER_ID) plays for, starting from a given date (STARTING_DATE). So we have something like this:
PLAYER_ID TEAM_ID STARTING_DATE
--------- ------- -------------
1 1 20/10/2008...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.