I have the tables below in my database:
Student (Stud_no: string, Stud_name: string)
Membership (Mem_no: string, Stud_no: string)
Book (book_no: string,
Note that we stopped writing queries this way ca. 1992. Come. Join us.
FWIW, I find this easier to read...
SELECT s.stud_name
, b.book_name
, b.author
, r.iss_date
FROM student s
JOIN membership m
ON m.stud_no = s.stud_no
JOIN iss_rec r
ON r.Mem_no = m.Mem_no
JOIN book b
ON b.book_no = r.book_no
WHERE r.iss_date BETWEEN '2019-08-06 00:00:00' AND '2019-08-06 23:59:59';
Just write you query as:
AND iss_date >= '2019-08-06'
AND iss_date < '2019-08-07'
Or more conveniently:
AND iss_date >= '2019-08-06'
AND iss_date < '2019-08-06' + INTERVAL 1 DAY
While this looks lengthy, it can use indexes more efficiently and very generic.
You can use DATE
function
AND DATE(iss_date) = '2019-08-06';