Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update ccc
- set RDate = b.Record_date,
- BP = b.BloodPressure
- FROM ccc a JOIN anthropometry b
- ON a.ID = b.ID and
- b.Record_date = a.Vdate
- Table aaa
- ID VDate Visit
- 10003 2003-09-26 00:00:00.000 1
- 10003 2004-05-15 00:00:00.000 2
- 10003 2007-01-09 00:00:00.000 3
- 10003 2007-07-05 00:00:00.000 4
- Table bbb
- ID Rdate BP
- 10003 2003-09-26 00:00:00.000 89
- 10003 2004-05-17 00:00:00.000 70
- 10003 2007-01-12 00:00:00.000 95
- I would want
- ID VDate Visit RDate BP
- 10003 2003-09-26 00:00:00.000 1 2003-09-26 00:00:00.000 89
- 10003 2004-05-15 00:00:00.000 2 2004-05-17 00:00:00.000 70
- 10003 2007-01-09 00:00:00.000 3 2007-01-12 00:00:00.000 95
- 10003 2007-07-05 00:00:00.000 4 Null Null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement