How do you organize this Mysql logic


tahuedur islam

I am using a Morris chart to display daily benchmark data. Suppose a person (manID) eats #3 times a day in the morning, noon, and afternoon. So I enter data like this

Table: table
--------------------------------------------------------------------
| manId(AI)(PK) |  date | schedules | amount | blah | [....]
--------------------------------------------------------------------

When I query to display morris chart data it will list each data like this

 102 - 01/01/2016 - 0.5 KG (morning time data)
 102 - 01/01/2016 - 0.5 KG (noon time data)
 102 - 01/01/2016 - 0.5 KG (after_noon time data)
 103 - 01/01/2016 - 0.5 KG (morning time data)

What I want to do is to show this wisely every day

102 - 01/01/2016 - 1.5 KG (Sum all schedules)
103 - 02/01/2016 - 1.5 KG (Sum all schedules)
104 - 03/01/2016 - 1.5 KG (Sum all schedules)
fall study

Columns and all values ​​used GROUP BY.datesum

SELECT id,date,SUM(amount)
FROM table_name
GROUP BY date;

Related


How do you organize tests in a modular Java project?

jactor is lined up: I create a modular build (using module-info.java) on GitHub , but when adding module-info.java to the module I want to modularize, no tests can be executed... How can I do this? I use the following version: junit.jupiter version 5.3.0 (firs

How do you organize class source code in Java?

Alexey: My average class so far contains about 500 lines of code and about 50 methods. The IDE is Eclipse, and here I have "Save Actions" enabled so that the methods are sorted alphabetically, public first, then private. To find any specific method in your cod

How do you organize ant macrodefs used by multiple projects?

Lieven Cardoen I'd like each Git repository to have its own build.xml file, but avoid copy-pasting macrodefs used by many different build scripts. What is the best way to organize? Add ant macrodefs to a separate Git repository and make them available to all b

How do you organize mail in a multilingual Laravel application

propagandist I'm curious how to generate emails efficiently in a multilingual application. To keep all the answers consistent: Suppose you have a typical business news book with lots of images, markup, and of course many paragraphs of text. All text is assumed

How do you organize tests in a modular Java project?

jactor is lined up: I create a modular build (using module-info.java) on GitHub , but when adding module-info.java to the module I want to modularize, no tests can be executed... How can I do this? I use the following version: junit.jupiter version 5.3.0 (firs

How do you organize class source code in Java?

Alexey: My average class so far contains about 500 lines of code and about 50 methods. The IDE is Eclipse, and here I have "Save Actions" enabled so that the methods are sorted alphabetically, public first, then private. To find any specific method in your cod

How do you organize/read large amounts of data?

genx1mx6 I have a lot of data saved as Data::Dumper output. How should I read this data? I'd like to restructure it, but I'm completely lost in this approach. Data structures are hashes in arrays, they are hashes of hashes... Here is a (very stripped down) exa

How do you organize this Mysql logic

tahuedur islam I am using a Morris chart to display daily benchmark data. Suppose a person (manID) eats #3 times a day in the morning, noon, and afternoon. So I enter data like this Table: table -----------------------------------------------------------------

How do you organize mail in a multilingual Laravel application

propagandist I'm curious how to generate emails efficiently in a multilingual application. To keep all the answers consistent: Suppose you have a typical business news book with lots of images, markup, and of course many paragraphs of text. All text is assumed

How do you organize this daily report Mysql logic

tahuedur islam I am showing daily data. Suppose a person has to eat twice a day, morning and night. So I enter data like this. Table: Reports -------------------------------------- ID | HumanID | date | schedule | amount| -----------------------------

How do you organize/read large amounts of data?

genx1mx6 I have a lot of data saved as Data::Dumper output. How should I read this data? I'd like to restructure it, but I'm completely lost in this approach. Data structures are hashes in arrays, they are hashes of hashes... Here is a (very stripped down) exa

How do you organize 2 dataframes based on common row values?

Steve Lewis I have 2 dataframe objects with generic transcript names. The names are out of order with respect to each other, so I'm trying to index them and pull rows to organize the data based on the first column of transcript names. I want to keep all the di

How do you organize this Mysql logic

tahuedur islam I am using a Morris chart to display daily benchmark data. Suppose a person (manID) eats #3 times a day in the morning, noon, and afternoon. So I enter data like this Table: table -----------------------------------------------------------------

How do you organize Java bean property names?

Saori Mudo Referring to this , I'm wondering how to choose a "proper" name for a Java bean property? method 1: public Class People{ private Integer peopleId; private String petName; .... } Way 2: public Class People{ private Integer people_i

How do you organize imports in Eclipse using Pydev?

chm I'm looking for a way to sort and remove unused imports. Cmd + Shift + O will only add used modules. (Sorry if this is a duplicate, I can't really find anything non-Java.) Aaron Digulla I don't know an easy way to do this. My approach is two steps: remove

How do you organize ant macrodefs used by multiple projects?

Lieven Cardoen I'd like each Git repository to have its own build.xml file, but avoid copy-pasting macrodefs used by many different build scripts. What is the best way to organize? Add ant macrodefs to a separate Git repository and make them available to all b

How do you organize Java bean property names?

Saori Mudo Referring to this , I'm wondering how to choose a "correct" name for a Java bean property? Way 1: public Class People{ private Integer peopleId; private String petName; .... } Way 2: public Class People{ private Integer people_id;

How do you organize tests in a modular Java project?

jactor is lined up: I create a modular build (using module-info.java) on GitHub , but when adding module-info.java to the module I want to modularize, no tests can be executed... How can I do this? I use the following version: junit.jupiter version 5.3.0 (firs

How do you organize class source code in Java?

Alexey: My average class so far contains about 500 lines of code and about 50 methods. The IDE is Eclipse, and here I have "Save Actions" enabled so that the methods are sorted alphabetically, public first, then private. To find any specific method in your cod

How do you organize mail in a multilingual Laravel application

propagandist I'm curious how to generate emails efficiently in a multilingual application. To keep all the answers consistent: Suppose you have a typical business news book with lots of images, markup, and of course many paragraphs of text. All text is assumed

How do you organize 2 dataframes based on common row values?

Steve Lewis I have 2 dataframe objects with generic transcript names. The names are out of order with respect to each other, so I'm trying to index them and pull rows to organize the data based on the first column of transcript names. I want to keep all the di

How do you organize imports in Eclipse using Pydev?

chm I'm looking for a way to sort and remove unused imports. Cmd + Shift + O will only add used modules. (Sorry if this is a duplicate, I can't really find anything non-Java.) Aaron Digulla I don't know an easy way to do this. My approach is two steps: remove

How do you organize file downloads?

averageUsername123 An unconventional question here, but I'm curious about how you guys organize your files (and if you use any automated tools). Usually, I end up just keeping everything in my Downloads folder and it gets messy pretty quickly. Are there any go

How do you organize Java bean property names?

Saori Mudo Referring to this , I'm wondering how to choose a "correct" name for a Java bean property? Way 1: public Class People{ private Integer peopleId; private String petName; .... } Way 2: public Class People{ private Integer people_id;

How do you organize Bing Cogntivie Services API news requests?

Ruthus99 I'm currently writing an application that uses the Bing Cognitive Services search API, and I'm trying to scrape news results in particular, and I'm running into some issues For normal searches, the structure of the request is very simple: def bing_sea

How do you organize Bing Cogntivie Services API news requests?

Ruthus99 I'm currently writing an application that uses the Bing Cognitive Services search API, and I'm trying to scrape news results in particular, and I'm running into some issues For normal searches, the structure of the request is very simple: def bing_sea