Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID | VALID_FROM | VALID_TO
- 1 | 01.01.2000 | 04.01.2000
- 1 | 04.01.2000 | 16.01.2000
- 1 | 16.01.2000 | 17.01.2000
- 1 | 17.01.2000 | 19.01.2000
- 2 | 03.02.2001 | 04.04.2001
- 2 | 04.04.2001 | 14.03.2001
- 2 | 14.04.2001 | 18.03.2001
- ID | VAR | VALID_FROM | VALID_TO
- 1 | 3 | 01.01.2000 | 17.01.2000
- 1 | 2 | 17.01.2000 | 19.01.2000
- 2 | 4 | 03.02.2001 | 14.03.2001
- select t1.*,
- t2.var
- from t1 t1
- inner join t2 t2
- on t1.id = t2.id
- and t1.valid_from >= t2.valid_from
- and t1.valid_to <= t2.valid_to;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement