Do the top ten want to query the number every day data should be how to write SQL statements
CodePudding user response:
Select * from table where create_time number='the date today' order by desc limit 10CodePudding user response:
Is not as long as a day to day before tenCodePudding user response:
This code level solve ahCodePudding user response:
Or on a stored procedureCodePudding user response:
Select *The from (
Select the if (@ date=a.c reate_time, @ rownum:=@ rownum + 1, @ rownum:=1) as rownum,
@ date:=a.c reate_time, a.c olumn1, biggest olumn2...
The from (
Select *
From the table
The order by create_time, quantity desc). A,
: (select @ rownum=0, @ date:=' ')
b) a
Where a.r ownum & lt;=10;