current position:Home>Database to query the quantity of books lent in this month. If it is higher than 10, it will display "more than 10 books lent in this month". Otherwise, it will display "less than 10 books lent in this month"

Database to query the quantity of books lent in this month. If it is higher than 10, it will display "more than 10 books lent in this month". Otherwise, it will display "less than 10 books lent in this month"

2022-06-24 08:48:29CSDN Q & A

database ,MySQL, The book management system
problem : Query the quantity of books lent this month , If it is higher than 10 Ben Shi , Show “ The number of books lent this month is greater than 10 Ben ”, Otherwise, it will show “ Books lent this month are less than 10 Ben ”.
My code can already query the number of books lent this month ,
But the following display is greater than or less than 10 This statement will not write .

select b_id,sum(borrow.number) from borrow where month(bodate)=month(now()) group by b_id;

Thank you for your answer .

remarks :
borrow: Table name
b_id: Book number
number: Number of books lent
bodate: Borrowing date

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/175/202206171554439656.html

Random recommended