Hi, the structure of my table is roughly like this Project number: expected transaction date status update date project status lead-12016-6-42016-3-1 Tracking lead-12016-6-52016- 3-2 lead-12016-7-52016-3-3 review lead-22016-3-52016-3-1 Tracking lead-22016-4-92016-3-3- 2. the result obtained in the review is that, from January 1, 00000 to January 1, 00000, 0100... mysqljson consultation
Hi, the structure of my table is roughly like this.
Project No. expected transaction date status update date Project status
Lead-1 2016-6-4 2016-3-1 tracking
Lead-1 under negotiation
Lead-1 under review
Lead-2 tracking
Lead-2 under review
The expected result is as follows:
From January 1, to January 1
Tracking 0 0 0 0 0
0 0 0 0 0 0 in negotiation
0 1 0 0 1 in review
Or you may want this result.
Number of month statuses
March tracking 0
Negotiation in March: 0
0 in March audit
April tracking 0
Negotiation in April: 0
Audit in April 1
May tracking 0
Negotiation in May: 0
0 in May audit
June tracking 0
Negotiation in June: 0
0 in June audit
July tracking 0
Negotiation in July: 0
Audit in April 1
That is, I only count the data of the latest status of each leadcode, and make statistics based on the estimated transaction date and project status of the data, the final expected result of the statistics, such as the second or third table
This is mainly used for returning to the front-end for drawing highchart .. I want to call the data in the form of "data. project status. month" or "data. MONTH. project status" after the query result is json. Is it possible to do this?
Thank you very much!
Or you can use other ideas to achieve the same content.