Can you use table common expression CTE?
;WITH temp AS (
SELECT ROW_NUMBER() OVER (PARTITION BY BookISBN
ORDER BY LastCheckOutDate DESC
) AS myrownum
,*
from book )
SELECT * FROM temp WHERE myrownum = 1
Output:
myrownum BookISBN LastCheckOutDate PatronNumber
1 100004 2011-11-14 950101
1 100005 2016-01-11 950107
Now you can update the query to join LibraryInventory table, assuming all record in LibraryInventory are unique
Example:
;WITH temp AS (
SELECT ROW_NUMBER() OVER (PARTITION BY BookISBN
ORDER BY LastCheckOutDate DESC
) AS myrownum
,*
from book )
SELECT * FROM temp B JOIN LibraryInventory INV
ON B.BookISBN = INV.BookISBN
WHERE myrownum = 1