Ask the mysql experts to solve related problems, etc.

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.