We have in DB two books, first is loaned because it has the Friend ID, and the other is in the shelf.
I execute a class query to get all loaned books:
Query BooksLoaned() As %SQLQuery
{
SELECT *
FROM Library.Book
WHERE Friend IS NOT NULL
}
Which I have tested throught the portal: