I have 2 tables with values stored in the form below.
Table1 table 2 the first table should be updated as the bottom of the table 2. (The outcome) '2010-11-17' will be < strong> 3 rows since less than T2OpenDate T1Opendate and there being updated in only one event 2012-02-22 since this date other 3 top T1OpenDate Is slightly more in comparison and less than the fourth T1 OpenDate Can someone suggest updates lists for the above? Thank you so much for helping me so much. edit according to the command of Aaron Bertrand. If you have this particular If you want to improve on skill, then I suggest you read it:
ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162,987 399,519 orthopedic surgery zero 2011-08-19 162,987 399,525 acupuncture Zero 2011-08-19 162987 413 405 Anesthesiology zero 2011-09-28 162,987 517,174 chiropractic zero 2012-04- 26
ReferranceID StatusNumber position T2OpenDate 162,987 256,033 closed 2010-11-17 162,987 488,518 reopen 2012-02-22
ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162,987 399,519 orthopedic surgery 2010-11-17 2011-08-19 162 987 399 525 acupuncture 2010-11-17 2011-08-19 162 987 413 405 Anesthesiology 2010-11-17 2011-09-28 162,987 517,174 Chiropractic 2012-02-22 2012-04-26
update Table1 set T2OpenDate = (Max (selection table 2.T2OpenDate) from table 2 where table 2.T2OpenDate & lt; table Table1.T1OpenDate 1
Comments
Post a Comment