Count row with month and other conditionCan I concatenate multiple MySQL rows into one field?Getting the number of rows with a GROUP BY queryLooking for a mysql query to count all rows previous to last monthmysql select the count of records for every monthCounts the occurrence of data in table1 based on presence of same data in table2 and group summary by year and monthCounting number of grouped rows in mysqlSQL Query : Order In monthHow to display tree results count by each month?Selecting rows of data into monthsMysql select where in() for each id return equal rows count
Magical attacks and overcoming damage resistance
What is the best way to deal with NPC-NPC combat?
Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Rudin 2.10 (b) Example
Which big number is bigger?
How can I practically buy stocks?
All ASCII characters with a given bit count
Find the identical rows in a matrix
Mistake in years of experience in resume?
Why is the underscore command _ useful?
Is there really no use for MD5 anymore?
Creating a chemical industry from a medieval tech level without petroleum
Zonal Statistics is returning null values in ArcGIS
Drawing a german abacus as in the books of Adam Ries
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
My admission is revoked after accepting the admission offer
A strange hotel
How do I reattach a shelf to the wall when it ripped out of the wall?
Can a barbarian keep raging if she shoves an enemy on her turn?
How to pronounce 'c++' in Spanish
std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?
How long after the last departure shall the airport stay open for an emergency return?
Retract an already submitted recommendation letter (written for an undergrad student)
Count row with month and other condition
Can I concatenate multiple MySQL rows into one field?Getting the number of rows with a GROUP BY queryLooking for a mysql query to count all rows previous to last monthmysql select the count of records for every monthCounts the occurrence of data in table1 based on presence of same data in table2 and group summary by year and monthCounting number of grouped rows in mysqlSQL Query : Order In monthHow to display tree results count by each month?Selecting rows of data into monthsMysql select where in() for each id return equal rows count
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I know we can count rows easily, but i have some problem doing that.
I tried to count row where the value is not equal to '-' in each month. This query below counts all row in all months.
SELECT MONTHNAME(tanggal) as bulan,
(SELECT COUNT(iad) FROM triwulan WHERE iad!='-') as iadp,
(SELECT COUNT(isk) FROM triwulan WHERE isk!='-') as isk,
(SELECT COUNT(vap) FROM triwulan WHERE vap!='-') as vap,
(SELECT COUNT(hap) FROM triwulan WHERE hap!='-') as hap,
(SELECT COUNT(plebitis) FROM triwulan WHERE plebitis!='tidak') as plebitis
FROM `triwulan`
group by bulan
I would appreciate any help, thank you..
mysql codeigniter
add a comment |
I know we can count rows easily, but i have some problem doing that.
I tried to count row where the value is not equal to '-' in each month. This query below counts all row in all months.
SELECT MONTHNAME(tanggal) as bulan,
(SELECT COUNT(iad) FROM triwulan WHERE iad!='-') as iadp,
(SELECT COUNT(isk) FROM triwulan WHERE isk!='-') as isk,
(SELECT COUNT(vap) FROM triwulan WHERE vap!='-') as vap,
(SELECT COUNT(hap) FROM triwulan WHERE hap!='-') as hap,
(SELECT COUNT(plebitis) FROM triwulan WHERE plebitis!='tidak') as plebitis
FROM `triwulan`
group by bulan
I would appreciate any help, thank you..
mysql codeigniter
1
This kind of problem is symptomatic of poor design. Consider having oneinfection_type
column, with a row for each infection type.
– Strawberry
Mar 9 at 8:36
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02
add a comment |
I know we can count rows easily, but i have some problem doing that.
I tried to count row where the value is not equal to '-' in each month. This query below counts all row in all months.
SELECT MONTHNAME(tanggal) as bulan,
(SELECT COUNT(iad) FROM triwulan WHERE iad!='-') as iadp,
(SELECT COUNT(isk) FROM triwulan WHERE isk!='-') as isk,
(SELECT COUNT(vap) FROM triwulan WHERE vap!='-') as vap,
(SELECT COUNT(hap) FROM triwulan WHERE hap!='-') as hap,
(SELECT COUNT(plebitis) FROM triwulan WHERE plebitis!='tidak') as plebitis
FROM `triwulan`
group by bulan
I would appreciate any help, thank you..
mysql codeigniter
I know we can count rows easily, but i have some problem doing that.
I tried to count row where the value is not equal to '-' in each month. This query below counts all row in all months.
SELECT MONTHNAME(tanggal) as bulan,
(SELECT COUNT(iad) FROM triwulan WHERE iad!='-') as iadp,
(SELECT COUNT(isk) FROM triwulan WHERE isk!='-') as isk,
(SELECT COUNT(vap) FROM triwulan WHERE vap!='-') as vap,
(SELECT COUNT(hap) FROM triwulan WHERE hap!='-') as hap,
(SELECT COUNT(plebitis) FROM triwulan WHERE plebitis!='tidak') as plebitis
FROM `triwulan`
group by bulan
I would appreciate any help, thank you..
mysql codeigniter
mysql codeigniter
edited Mar 9 at 8:06
Nick
42.2k142444
42.2k142444
asked Mar 9 at 8:01
Henry WilsonHenry Wilson
85
85
1
This kind of problem is symptomatic of poor design. Consider having oneinfection_type
column, with a row for each infection type.
– Strawberry
Mar 9 at 8:36
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02
add a comment |
1
This kind of problem is symptomatic of poor design. Consider having oneinfection_type
column, with a row for each infection type.
– Strawberry
Mar 9 at 8:36
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02
1
1
This kind of problem is symptomatic of poor design. Consider having one
infection_type
column, with a row for each infection type.– Strawberry
Mar 9 at 8:36
This kind of problem is symptomatic of poor design. Consider having one
infection_type
column, with a row for each infection type.– Strawberry
Mar 9 at 8:36
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02
add a comment |
1 Answer
1
active
oldest
votes
In response to comments, an example of a normalised design might look like this:
examination
examination_id tanggal
1 2019-02-01
2 2019-02-02
3 2019-02-03
4 2019-03-01
examination_detail
examination_id infection_type plebitis
1 iad iya
1 hap iya
2 hap tidak
3 isk iya
3 vap iya
4 isk tidak
4 vap tidak
You'd have to decide whether plebitis more properly belongs in the examination table or the detail table.
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075247%2fcount-row-with-month-and-other-condition%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In response to comments, an example of a normalised design might look like this:
examination
examination_id tanggal
1 2019-02-01
2 2019-02-02
3 2019-02-03
4 2019-03-01
examination_detail
examination_id infection_type plebitis
1 iad iya
1 hap iya
2 hap tidak
3 isk iya
3 vap iya
4 isk tidak
4 vap tidak
You'd have to decide whether plebitis more properly belongs in the examination table or the detail table.
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
add a comment |
In response to comments, an example of a normalised design might look like this:
examination
examination_id tanggal
1 2019-02-01
2 2019-02-02
3 2019-02-03
4 2019-03-01
examination_detail
examination_id infection_type plebitis
1 iad iya
1 hap iya
2 hap tidak
3 isk iya
3 vap iya
4 isk tidak
4 vap tidak
You'd have to decide whether plebitis more properly belongs in the examination table or the detail table.
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
add a comment |
In response to comments, an example of a normalised design might look like this:
examination
examination_id tanggal
1 2019-02-01
2 2019-02-02
3 2019-02-03
4 2019-03-01
examination_detail
examination_id infection_type plebitis
1 iad iya
1 hap iya
2 hap tidak
3 isk iya
3 vap iya
4 isk tidak
4 vap tidak
You'd have to decide whether plebitis more properly belongs in the examination table or the detail table.
In response to comments, an example of a normalised design might look like this:
examination
examination_id tanggal
1 2019-02-01
2 2019-02-02
3 2019-02-03
4 2019-03-01
examination_detail
examination_id infection_type plebitis
1 iad iya
1 hap iya
2 hap tidak
3 isk iya
3 vap iya
4 isk tidak
4 vap tidak
You'd have to decide whether plebitis more properly belongs in the examination table or the detail table.
edited Mar 9 at 15:42
answered Mar 9 at 14:10
StrawberryStrawberry
26.8k83250
26.8k83250
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
add a comment |
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
got it sir, thank you. I'll try to fix the table
– Henry Wilson
Mar 9 at 15:29
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075247%2fcount-row-with-month-and-other-condition%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This kind of problem is symptomatic of poor design. Consider having one
infection_type
column, with a row for each infection type.– Strawberry
Mar 9 at 8:36
Besides, if someone recovers from isk, but still has vap, how would you even record that with the current schema?
– Strawberry
Mar 9 at 12:02