I would like to get all the members who late the borrowed books returned. I have a borrowing table,examples of books table and the members table
Which statement should be used to retrieve the data of which member return after 30 days the books?
I hope this a clear explanation. Thanks in advance for your help!
This is the borrowing table:
This is the members table:
From what I can make of the images, the following query should work with some modifications:
SELECT Us.*, Bo.* FROM Borrowings Bo INNER JOIN Users Us ON Bo.LID_LIDNUMMER = Us.LIDNUMMER WHERE Bo.DATUM_BORROWED - Bo.DATUM_RETURNED > 30