Ask the mysql experts to solve the problem. please wait. what I need to do now is to display the data in this way. from a table, query the value of top-up for each server in 1-3 days, 4-7 days, 8-15 days, 16-30 days, and 31-60 days. for example, & nbsp; server recharge Phase 1-34-78-1516-3031-60 & nbsp; first server second server third server ask mysql experts to solve the problem, please wait.
What I need to do now is to display the data in this way, from a table, query the value of top-up for each server in 1-3 days, 4-7 days, 8-15 days, 16-30 days, and 31-60 days. for example
Server/recharge Phase 1-3 4-7 8-15 16-30 31-60
Server 1
Server 2
Server 3
After thinking about how to write for a long time, I still cannot write the most efficient... Solving
------ Solution --------------------
Just design the table structure:
SQL code
Table: id server stage1 one 22 two 13 one 4SQL: select * from table where stage between 1 and 4 and server = 'one'; result: id server stage1 one 23 one 4
------ Solution --------------------
Why is there 31-60? I don't quite understand the requirement -_-..
------ Solution --------------------
It is best to post your:
Create table .......;
Insert into table .........;
Expected Results + simple description
------ Solution --------------------
The most efficient is to insert each statistical statement directly into a statistical table...