 |
|
ถ้าหลายคน
Code (SQL)
select id, year(e_now),
sum(if(month(e_now)=1,1,0)) m01,
sum(if(month(e_now)=2,1,0)) m02,
sum(if(month(e_now)=3,1,0)) m03,
sum(if(month(e_now)=4,1,0)) m04,
sum(if(month(e_now)=5,1,0)) m05,
sum(if(month(e_now)=6,1,0)) m06,
sum(if(month(e_now)=7,1,0)) m07,
sum(if(month(e_now)=8,1,0)) m08,
sum(if(month(e_now)=9,1,0)) m09,
sum(if(month(e_now)=10,1,0)) m10,
sum(if(month(e_now)=11,1,0)) m11,
sum(if(month(e_now)=12,1,0)) m12
from table
group by year(e_now), id
|
 |
 |
 |
 |
Date :
2016-11-02 19:06:21 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |