mysql - My SQL Convert Rows to Column Dynamicaly -
how can type of result.
table |id | companyname| ----+------------- |1 |companya | |2 |companyb | |3 |companyc |
and table b have primary id of table a
table b |id | studentname|companyid |submitdate ----+------------+----------+---------- |1 |abc |1 |2017-01-02 |2 |abc |2 |2017-01-03 |3 |abc |1 |2017-01-02 |4 |abc |3 |2017-01-03 |5 |abc |1 |2017-01-03 |6 |abc |1 |2017-01-01 |7 |abc |2 |2017-01-02 |8 |abc |2 |2017-01-03 |9 |abc |3 |2017-01-02
how count number of entry particular company each date.
here result table want.
|submitdate | companya |companyb |companyc ------------+----------+---------- |2017-01-01 |1 |0 |0 |2017-01-02 |2 |1 |1 |2017-01-03 |1 |2 |1
Comments
Post a Comment