Home > database >  For help, MYSQL query problem!!! Have the bosses provide ideas ~
For help, MYSQL query problem!!! Have the bosses provide ideas ~

Time:10-08

Database table structure for the id to add time 16:04:24 format (2020-08-13) and record the name, if the query isn't empty five days total number of records? If the record is empty just skip the query on the record of a day, the total number of days to five days, is there any big some directions?

CodePudding user response:

Select count (*) from the table where date_format (add time record, 'Y - m - % d % %) in the
(
Select distinct date_format (add time record, 'Y - m - % d % %) as the date from the table order by date desc limit 5
)
  • Related