SQL simple query issue
sql, sql-server
Solution
select top 1 c.name, b.price
from books b
inner join cardsofcreaders cr on cr.book_id = b.book_id
inner join clients c on c.client_id = cr.client_id
order by b.price desc
Problem
I have a simple SQL question. I have 3 tables ``` Books -------------------- Book_ID(pk) | Title | Price -------------------- Clients --------------------- Client_ID(pk) | Name | CardsOfReaders --------------------- Book_ID(pk,fk)| Client_ID(pk, fk) ``` So the question is: How to display the name of the reader who borrowed the book with the highest price (and the column price to be displayed as well) Thanks in advance!