I have below columns in book_history table. Every new book taken will have entry in this table with a new auto increment id, current date, student id and book id.
Id, RecordCreatdOn, StudentId, BookId
I want to get students (studentId) who have last taken any book before '2017-12-31'. Can anyone help me with the query to fetch the same ?