Mysql, the difficulties of daily life

CSDN Q & A 2022-02-13 06:54:50 阅读数:911

mysql difficulties daily life

img

① Inquire about 2021 The number of recruitment information released each month in , Sort by the number of messages in descending order ( Tips :DATE_FORMAT())
② Inquire about 2021 year 6 The number of recruitment information released every day in the month .




Take the answer :

1.select count() from Table name where DATE_FORMAT( Time , '%Y') = '2021' group by DATE_FORMAT( Time , '%Y-%m') order by desc
2.select count(
) from Table name where DATE_FORMAT( Time , '%Y-%m') = '2021-06' group by DATE_FORMAT( Time , '%Y-%m-%d')


copyright:author[CSDN Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130654490478.html