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

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -