SQL: batch table updates based on MIN of another? Probably easy but stuck
I think it will be easy, but I can't see how!
I want to update the authors table so that the earliest field contains the year of the earliest book. I need to use MINI somehow, but how do I update them all with one request?
BookTable (BookID, AuthorFK, Year)
01 34 1943
02 34 1933
03 99 1910
04 62 1990
05 99 1901
AuthorTable (AuthorID, earliest)
34 1933
62 1990
99 1901
EDIT: HA HA WORKS TOTALLY THANKS FOR A SUPERIOR ANSWER! STACKO RULES (EXCEPT OPEN THINGS)
0
Katie
source
to share